:root {
  --font-display: "Sora", "Noto Sans SC", sans-serif;
  --font-body: "Plus Jakarta Sans", "Noto Sans SC", sans-serif;
  --font-doc-readable: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  --sidebar-width: 220px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --line-soft: rgba(8, 38, 63, 0.12);
  --line-strong: rgba(8, 38, 63, 0.2);
  --text-main: #0f2640;
  --text-subtle: #58708d;
  --text-inverse: #edf5ff;
  --accent: #0a8f83;
  --accent-strong: #0e6ee8;
  --accent-soft: rgba(10, 143, 131, 0.14);

  --panel-bg: rgba(255, 255, 255, 0.76);
  --panel-bg-strong: rgba(255, 255, 255, 0.9);
  --sidebar-bg: rgba(243, 249, 253, 0.8);
  --chip-bg: rgba(255, 255, 255, 0.8);

  --shadow-soft: 0 14px 30px rgba(8, 30, 56, 0.08);
  --shadow-panel: 0 20px 38px rgba(8, 30, 56, 0.12);

  --step--1: clamp(0.78rem, 0.73rem + 0.2vw, 0.88rem);
  --step-0: clamp(0.92rem, 0.87rem + 0.26vw, 1rem);
  --step-1: clamp(1.02rem, 0.97rem + 0.35vw, 1.16rem);
  --step-2: clamp(1.22rem, 1.08rem + 0.66vw, 1.56rem);
  --step-3: clamp(1.46rem, 1.22rem + 1.05vw, 2.08rem);
  --step-4: clamp(1.78rem, 1.4rem + 1.48vw, 2.7rem);
}

* {
  box-sizing: border-box;
}

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

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

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

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--text-main);
  background: var(--page-bg, radial-gradient(circle at 11% 8%, #f5fffc 0, #e9f4f6 36%, #e0ebf4 100%));
  transition: background 0.36s ease, color 0.24s ease;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 48vmax;
  height: 48vmax;
  border-radius: 50%;
  top: -22vmax;
  right: -12vmax;
  background: radial-gradient(circle at 30% 30%, rgba(41, 171, 187, 0.2), rgba(41, 171, 187, 0));
  filter: blur(12px);
}

body::after {
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  bottom: -20vmax;
  left: -10vmax;
  background: radial-gradient(circle at 40% 40%, rgba(14, 110, 232, 0.16), rgba(14, 110, 232, 0));
  filter: blur(18px);
}

body[data-bg="mist"] {
  --page-bg: radial-gradient(circle at 12% 8%, #f5fffc 0, #e9f4f6 36%, #e0ebf4 100%);
}

body[data-bg="dawn"] {
  --page-bg: radial-gradient(circle at 13% 8%, #fffaf0 0, #f7efdd 35%, #e7e5ee 100%);
}

body[data-bg="qinglv"] {
  --page-bg: radial-gradient(circle at 14% 9%, #eefcf7 0, #e0f3ec 36%, #d3e8df 100%);
}

body[data-bg="mihuang"] {
  --page-bg: radial-gradient(circle at 13% 8%, #fffaf0 0, #f6edd5 35%, #eadfbd 100%);
}

body[data-bg="hailan"] {
  --page-bg: radial-gradient(circle at 14% 9%, #ebf7ff 0, #dcecf8 37%, #cadff0 100%);
}

body[data-bg="huifen"] {
  --page-bg: radial-gradient(circle at 13% 8%, #fdf5f9 0, #efdfeb 35%, #e0cfdf 100%);
}

body[data-bg="gradient"] {
  --page-bg: linear-gradient(135deg, #dff6ff 0%, #e8f4f0 30%, #efe8ff 68%, #f9ecdc 100%);
}

body[data-bg="flow-gradient"] {
  --page-bg: linear-gradient(130deg, #dff6ff 0%, #d2eef0 26%, #e9ddff 52%, #ffdcdc 76%, #fff0ba 100%);
}

body[data-bg="flow-gradient"]:not(.has-custom-background) {
  background-size: 240% 240%;
  animation: flow-gradient-bg 18s ease-in-out infinite;
}

body.has-custom-background {
  animation: none;
}

body[data-theme="dark"] {
  --line-soft: rgba(221, 235, 255, 0.14);
  --line-strong: rgba(221, 235, 255, 0.24);
  --text-main: #e4eefe;
  --text-subtle: #99afca;
  --text-inverse: #e8f0fd;
  --accent: #34d0bf;
  --accent-strong: #4c96ff;
  --accent-soft: rgba(52, 208, 191, 0.18);

  --panel-bg: rgba(8, 23, 40, 0.76);
  --panel-bg-strong: rgba(9, 26, 45, 0.9);
  --sidebar-bg: rgba(8, 18, 31, 0.8);
  --chip-bg: rgba(11, 28, 47, 0.8);

  --shadow-soft: 0 14px 30px rgba(3, 10, 20, 0.42);
  --shadow-panel: 0 22px 44px rgba(2, 8, 18, 0.56);
}

body[data-theme="dark"][data-bg="mist"] {
  --page-bg: radial-gradient(circle at 13% 8%, #183247 0, #11283e 36%, #0b1a2f 100%);
}

body[data-theme="dark"][data-bg="dawn"] {
  --page-bg: radial-gradient(circle at 15% 8%, #3e3227 0, #2b2f3a 37%, #161e2f 100%);
}

body[data-theme="dark"][data-bg="qinglv"] {
  --page-bg: radial-gradient(circle at 15% 8%, #163b34 0, #112f2a 37%, #0b221d 100%);
}

body[data-theme="dark"][data-bg="mihuang"] {
  --page-bg: radial-gradient(circle at 15% 8%, #40341f 0, #322917 37%, #241c10 100%);
}

body[data-theme="dark"][data-bg="hailan"] {
  --page-bg: radial-gradient(circle at 15% 8%, #143755 0, #102b45 37%, #0a1f33 100%);
}

body[data-theme="dark"][data-bg="huifen"] {
  --page-bg: radial-gradient(circle at 15% 8%, #3a2b38 0, #2d2230 37%, #201822 100%);
}

body[data-theme="dark"][data-bg="gradient"] {
  --page-bg: linear-gradient(135deg, #173447 0%, #1d3c35 30%, #2d2645 66%, #432d2b 100%);
}

body[data-theme="dark"][data-bg="flow-gradient"] {
  --page-bg: linear-gradient(130deg, #123651 0%, #1b443e 28%, #2c2450 54%, #4a2737 78%, #4a3a1d 100%);
}

body[data-theme="dark"] .sidebar {
  background:
    linear-gradient(168deg, rgba(165, 207, 255, 0.05), rgba(151, 197, 245, 0.015) 42%, rgba(10, 30, 52, 0.08)),
    linear-gradient(180deg, rgba(19, 84, 159, 0.08), rgba(8, 35, 68, 0.14)),
    rgba(8, 18, 31, 0.18);
  border-inline-end-color: rgba(143, 197, 255, 0.16);
  box-shadow:
    inset 1px 0 0 rgba(190, 224, 255, 0.07),
    inset -1px 0 0 rgba(40, 126, 205, 0.08),
    12px 0 24px rgba(0, 7, 18, 0.16);
}

body[data-theme="dark"] .sidebar::before {
  opacity: 0.22;
  background: linear-gradient(180deg, rgba(185, 220, 255, 0.075) 0, rgba(146, 191, 255, 0.02) 35%, rgba(9, 24, 43, 0) 70%, rgba(116, 175, 248, 0.03) 100%);
}

body[data-theme="dark"] .sidebar::after {
  background:
    radial-gradient(120% 80% at 0% -8%, rgba(123, 198, 255, 0.08), transparent 58%),
    radial-gradient(90% 70% at 0% 108%, rgba(25, 128, 244, 0.09), transparent 62%);
}

body[data-theme="dark"] .menu-item:hover,
body[data-theme="dark"] .utility-item:hover {
  background: rgba(143, 197, 255, 0.05);
}

body[data-theme="dark"] .sidebar-nav,
body[data-theme="dark"] .sidebar-footer {
  scrollbar-color: rgba(148, 194, 232, 0.72) rgba(10, 25, 43, 0.54);
}

body[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-track,
body[data-theme="dark"] .sidebar-footer::-webkit-scrollbar-track {
  background: rgba(10, 25, 43, 0.54);
}

body[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb,
body[data-theme="dark"] .sidebar-footer::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(154, 199, 235, 0.82), rgba(109, 166, 214, 0.76));
}

body[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .sidebar-footer::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(176, 216, 247, 0.9), rgba(128, 185, 232, 0.84));
}

body[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-button,
body[data-theme="dark"] .sidebar-footer::-webkit-scrollbar-button {
  height: 0;
  background: transparent;
}

body[data-theme="dark"] .menu-item.is-active {
  background: linear-gradient(134deg, rgba(52, 208, 191, 0.08), rgba(76, 150, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(143, 197, 255, 0.13);
}

body[data-theme="dark"] .visit-query-row input {
  color: #e8f3ff;
  background: rgba(7, 27, 46, 0.9);
  border-color: rgba(140, 194, 243, 0.38);
  color-scheme: dark;
}

body[data-theme="dark"] .visit-query-row input::-webkit-datetime-edit {
  color: #e8f3ff;
}

body[data-theme="dark"] .visit-query-row input::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.35);
  opacity: 0.92;
}

body[data-theme="dark"] .visit-query-row input:focus {
  outline: none;
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .visit-query-row span,
body[data-theme="dark"] .visit-query small {
  color: #a8c1db;
}

body[data-theme="dark"] .bg-image-field input[type="file"],
body[data-theme="dark"] .bg-image-url-row input {
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
  border-color: rgba(140, 194, 243, 0.38);
}

body[data-theme="dark"] .bg-image-mode-option {
  background: rgba(7, 27, 46, 0.9);
  border-color: rgba(140, 194, 243, 0.38);
  color: #e8f3ff;
}

body[data-theme="dark"] .bg-image-mode-option:has(input[type="radio"]:checked) {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(89, 197, 255, 0.3);
}

body[data-theme="dark"] .bg-image-file-row button,
body[data-theme="dark"] .bg-image-url-row button,
body[data-theme="dark"] .bg-image-actions button {
  border-color: rgba(140, 194, 243, 0.38);
}

body[data-theme="dark"] .visit-popover {
  background: rgba(7, 27, 46, 0.92);
  border-color: rgba(140, 194, 243, 0.4);
}

body[data-theme="dark"] .visit-stats li {
  background: rgba(15, 42, 68, 0.82);
  border-color: rgba(140, 194, 243, 0.44);
}

body[data-theme="dark"] .visit-stats span {
  color: #d5e8fa;
  font-weight: 650;
}

body[data-theme="dark"] .visit-stats strong {
  color: #f2f8ff;
}

body[data-theme="dark"] .visit-query p {
  color: #e3f0ff;
}

body[data-theme="dark"] .visit-reset-btn {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(11, 36, 60, 0.86);
  color: #e8f3ff;
}

body[data-theme="dark"] .calendar-toggle,
body[data-theme="dark"] .calendar-popover,
body[data-theme="dark"] .calendar-nav button,
body[data-theme="dark"] .calendar-month-trigger,
body[data-theme="dark"] .calendar-month-picker,
body[data-theme="dark"] .calendar-month-picker select,
body[data-theme="dark"] .calendar-picker-actions button,
body[data-theme="dark"] .calendar-day {
  border-color: rgba(140, 194, 243, 0.36);
}

body[data-theme="dark"] .calendar-month-picker {
  background: rgba(7, 27, 46, 0.62);
}

body[data-theme="dark"] .calendar-month-picker select {
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
  color-scheme: dark;
}

body[data-theme="dark"] .calendar-month-picker label {
  color: #b6cde4;
}

body[data-theme="dark"] .calendar-day {
  background: rgba(7, 27, 46, 0.76);
}

body[data-theme="dark"] .calendar-day.is-selected {
  background: linear-gradient(140deg, rgba(89, 197, 255, 0.3), rgba(37, 240, 204, 0.2));
  border-color: rgba(89, 197, 255, 0.84);
}

body[data-theme="dark"] .calendar-summary {
  background: rgba(7, 27, 46, 0.68);
}

body[data-theme="dark"] .calendar-week-row span,
body[data-theme="dark"] .calendar-term-list li {
  color: #b6cde4;
}

body[data-theme="dark"] .calendar-section p,
body[data-theme="dark"] .calendar-summary p,
body[data-theme="dark"] .calendar-nav strong {
  color: #dbeafe;
}

body[data-theme="dark"] .calendar-data-mode {
  background: rgba(7, 27, 46, 0.7);
  border-color: rgba(140, 194, 243, 0.36);
}

body[data-theme="dark"] .calendar-data-mode small {
  color: #b6cde4;
}

body[data-theme="dark"] .calendar-popover {
  scrollbar-color: rgba(149, 193, 229, 0.68) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .calendar-popover::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .calendar-popover::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .calendar-popover::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 10;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(166deg, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0.05) 38%, rgba(255, 255, 255, 0.01) 100%),
    linear-gradient(180deg, rgba(30, 133, 218, 0.035), rgba(8, 80, 148, 0.02) 64%, rgba(7, 48, 91, 0.035)),
    var(--sidebar-bg);
  border-inline-end: 1px solid var(--line-soft);
  backdrop-filter: blur(30px) saturate(114%);
  -webkit-backdrop-filter: blur(30px) saturate(114%);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    10px 0 22px rgba(3, 15, 30, 0.08);
  transition: transform 0.32s ease, width 0.26s ease, background 0.26s ease, box-shadow 0.26s ease;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0.045) 34%, rgba(255, 255, 255, 0.01) 70%, rgba(255, 255, 255, 0.08) 100%);
  opacity: 0.26;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 0% -8%, rgba(127, 205, 255, 0.1), transparent 58%),
    radial-gradient(90% 70% at 0% 108%, rgba(23, 120, 228, 0.08), transparent 62%);
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-top {
  min-height: 84px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.logo-wrap {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, rgba(249, 255, 254, 0.92), rgba(220, 232, 250, 0.86));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 10px 18px rgba(10, 32, 54, 0.16);
}

.logo-wrap svg {
  width: 34px;
  height: 34px;
}

.logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-text {
  font-family: var(--font-display);
  font-size: clamp(1.34rem, 1.22rem + 0.54vw, 1.72rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar-nav,
.sidebar-footer {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.62) rgba(255, 255, 255, 0.16);
}

.sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar,
.sidebar-footer::-webkit-scrollbar {
  width: 9px;
}

.sidebar-nav::-webkit-scrollbar-track,
.sidebar-footer::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.sidebar-footer::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(43, 131, 191, 0.8), rgba(33, 105, 174, 0.76));
}

.sidebar-nav::-webkit-scrollbar-thumb:hover,
.sidebar-footer::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(56, 149, 210, 0.9), rgba(40, 121, 195, 0.82));
}

.sidebar-nav::-webkit-scrollbar-button,
.sidebar-footer::-webkit-scrollbar-button {
  height: 0;
  background: transparent;
}

.menu-item,
.utility-item {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease;
}

.menu-item:hover,
.utility-item:hover {
  background: rgba(255, 255, 255, 0.5);
}

.menu-item:active,
.utility-item:active {
  transform: scale(0.985);
}

.menu-item.is-active {
  background: linear-gradient(140deg, var(--accent-soft), rgba(255, 255, 255, 0.14));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.28);
}

.menu-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.menu-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-label {
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: opacity 0.2s ease, width 0.2s ease;
}

#collapseToggle svg {
  transition: transform 0.22s ease;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

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

.topbar {
  min-height: 84px;
  padding: 8px 22px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 40;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1)), var(--panel-bg);
  backdrop-filter: blur(10px);
}

.topbar-left,
.topbar-right {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left {
  flex: 1 1 auto;
}

.topbar-right {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.local-transfer-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.headline {
  min-width: 0;
}

.headline h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.24rem, 1.06rem + 0.72vw, 1.66rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.headline p {
  margin: 2px 0 0;
  color: var(--text-subtle);
  font-size: var(--step-0);
  line-height: 1.28;
}

.mobile-trigger {
  display: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-chip {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--chip-bg);
  color: inherit;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, transform 0.15s ease;
}

.top-chip:hover {
  border-color: var(--line-strong);
}

.top-chip:active {
  transform: scale(0.98);
}

.top-chip svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.top-chip-icon {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  position: relative;
}

.top-chip-icon::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translate(-50%, -4px);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-bg-strong);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
  padding: 6px 10px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 60;
}

.top-chip-icon:hover::after,
.top-chip-icon:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.top-chip-icon.is-authenticated {
  border-color: rgba(10, 143, 131, 0.56);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.2), var(--shadow-soft);
}

.local-transfer-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
}

.calendar-chip {
  position: relative;
  z-index: 46;
}

.calendar-toggle {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--chip-bg);
  color: inherit;
  min-height: 44px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, transform 0.15s ease;
}

.calendar-toggle:hover {
  border-color: var(--line-strong);
}

.calendar-toggle:active {
  transform: scale(0.985);
}

.calendar-date {
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--text-subtle);
  font-weight: 600;
  white-space: nowrap;
}

.calendar-time {
  font-size: var(--step-0);
  line-height: 1.2;
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  width: 100%;
  text-align: center;
}

.calendar-lunar {
  font-size: 0.64rem;
  line-height: 1.2;
  color: var(--text-subtle);
  font-weight: 500;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 58;
  width: min(460px, 92vw);
  max-height: min(76vh, 620px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.52) rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel-bg-strong);
  box-shadow: var(--shadow-panel);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.calendar-popover::-webkit-scrollbar {
  width: 10px;
}

.calendar-popover::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.calendar-popover::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(30, 125, 188, 0.72), rgba(16, 95, 171, 0.62));
  border-radius: 999px;
}

.calendar-popover::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(30, 125, 188, 0.86), rgba(16, 95, 171, 0.76));
}

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

.calendar-popover-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-0);
}

.calendar-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-nav > button:not(.calendar-month-trigger) {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  font-size: 0.98rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-nav > button.calendar-today-btn {
  width: auto;
  min-width: 46px;
  height: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.calendar-month-trigger {
  min-width: 116px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  cursor: pointer;
}

.calendar-month-trigger strong {
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.calendar-nav strong {
  min-width: 86px;
  text-align: center;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.calendar-month-picker {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.34);
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.calendar-month-picker label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.calendar-month-picker select {
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.74);
  color: inherit;
  font-family: inherit;
  font-size: 0.76rem;
  padding: 0 6px;
}

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

.calendar-picker-actions button {
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  padding: 0 9px;
  cursor: pointer;
}

.calendar-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-week-row span {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 700;
}

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

.calendar-day {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.32);
  color: inherit;
  font-family: inherit;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.calendar-day.is-empty {
  opacity: 0;
  pointer-events: none;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.42);
}

.calendar-day.is-selected {
  background: linear-gradient(140deg, rgba(14, 110, 232, 0.2), rgba(10, 143, 131, 0.14));
  border-color: rgba(14, 110, 232, 0.54);
}

.calendar-day .calendar-mark {
  display: block;
  font-size: 0.6rem;
  color: var(--accent);
  line-height: 1.1;
}

.calendar-summary {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.3);
  display: grid;
  gap: 4px;
}

.calendar-summary p {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
}

.calendar-section {
  border-top: 1px dashed var(--line-soft);
  padding-top: 8px;
}

.calendar-data-mode {
  margin: 0 0 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.28);
  display: grid;
  gap: 3px;
}

.calendar-data-mode strong {
  font-size: 0.74rem;
  letter-spacing: 0.01em;
}

.calendar-data-mode small {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-subtle);
  overflow-wrap: anywhere;
}

.calendar-section h4 {
  margin: 0 0 6px;
  font-size: 0.78rem;
}

.calendar-section p {
  margin: 0 0 4px;
  font-size: 0.74rem;
}

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

.calendar-term-list li {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.visit-chip {
  position: relative;
  z-index: 45;
}

.visit-toggle {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--chip-bg);
  color: inherit;
  min-height: 44px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, transform 0.15s ease;
}

.visit-toggle:hover {
  border-color: var(--line-strong);
}

.visit-toggle:active {
  transform: scale(0.985);
}

.visit-label {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--text-subtle);
  font-weight: 600;
  width: 100%;
  text-align: center;
}

.visit-value {
  font-size: var(--step--1);
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.visit-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  width: min(420px, 88vw);
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel-bg-strong);
  box-shadow: var(--shadow-panel);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.visit-popover h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-0);
}

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

.visit-popover-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visit-reset-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.visit-stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.visit-stats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.36);
}

.visit-stats span {
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.visit-stats strong {
  font-size: var(--step--1);
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.visit-query {
  padding-top: 2px;
  border-top: 1px dashed var(--line-soft);
}

.visit-query p {
  margin: 8px 0 8px;
  font-size: var(--step--1);
  font-weight: 700;
}

.visit-query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.visit-query-row input,
.visit-query-row button {
  min-height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  font-family: inherit;
  font-size: 0.76rem;
}

.visit-query-row input {
  color: inherit;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
  color-scheme: light;
}

.visit-query-row button {
  padding: 0 10px;
  background: var(--chip-bg);
  color: inherit;
  cursor: pointer;
}

.visit-query-row span {
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.visit-query small {
  display: block;
  margin-top: 6px;
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.content {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: clamp(16px, 2vw, 28px);
  display: grid;
  gap: clamp(12px, 1.6vw, 20px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.52) rgba(255, 255, 255, 0.16);
}

.content > * {
  width: min(1280px, 100%);
  margin-inline: auto;
}

.content::-webkit-scrollbar {
  width: 10px;
}

.content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(39, 130, 188, 0.7), rgba(31, 99, 168, 0.66));
}

.content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(44, 146, 206, 0.82), rgba(31, 113, 190, 0.76));
}

.site-footer {
  width: 100%;
  border-top: 0;
  padding: 12px 14px 14px;
  text-align: center;
}

.site-footer p {
  width: min(1280px, 100%);
  min-height: 46px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-subtle);
  letter-spacing: 0.01em;
}

.site-footer p a {
  color: inherit;
  text-decoration: none;
}

.site-footer p a:hover,
.site-footer p a:focus,
.site-footer p a:active,
.site-footer p a:visited {
  color: inherit;
  text-decoration: none;
}

.site-footer .icp-separator {
  margin: 0 14px;
}

.hero,
.stat-card,
.panel {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--panel-bg);
  box-shadow: var(--shadow-panel);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.4vw, 30px);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12));
}

.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -96px;
  top: -84px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(14, 110, 232, 0.2), rgba(14, 110, 232, 0));
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero h2 {
  margin: 0 0 10px;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 1.14;
  letter-spacing: 0.01em;
}

.hero .sub {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--step-1);
  max-width: 56ch;
}

.hero-search {
  display: grid;
  align-content: center;
  gap: 10px;
}

.hero-search label {
  font-size: var(--step-0);
  font-weight: 700;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font: inherit;
  color: inherit;
  background: var(--panel-bg-strong);
}

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

.search-row input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(14, 110, 232, 0.24);
}

.search-row button {
  border: 0;
  min-width: 122px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--step-0);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #0b9b8f, #1c66e7);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.15s ease;
}

.search-row button:hover {
  filter: saturate(1.1);
}

.search-row button:active {
  transform: translateY(1px);
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 15px;
}

.stat-card::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(10, 143, 131, 0.8), rgba(14, 110, 232, 0.8));
}

.stat-card p {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.stat-card h3 {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.26rem + 1.05vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.stat-card span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.portal-search-canvas {
  min-height: clamp(620px, 76vh, 860px);
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.16));
  overflow: hidden;
  isolation: isolate;
}

.portal-search-app {
  --ps-text: var(--text-main);
  --ps-text-muted: var(--text-subtle);
  --ps-border: var(--line-soft);
  --ps-border-strong: var(--line-strong);
  --ps-accent: var(--accent);
  --ps-accent-strong: var(--accent-strong);
  --ps-card-bg: rgba(255, 255, 255, 0.62);
  --ps-card-bg-strong: rgba(255, 255, 255, 0.78);
  --ps-soft-bg: rgba(255, 255, 255, 0.52);
  --ps-input-bg: rgba(255, 255, 255, 0.74);
  --ps-preview-modal-bg: #fdfefe;
  --ps-preview-surface: #ffffff;
  --ps-preview-surface-soft: #f6f9fc;
  --ps-preview-stage-dark: #102a43;
  --ps-overlay-bg: rgba(6, 25, 43, 0.34);
  --ps-shadow: 0 18px 40px rgba(8, 30, 56, 0.16);
  --ps-modal-shadow: 0 20px 44px rgba(8, 30, 56, 0.26);
  --ps-grid-line: rgba(14, 110, 232, 0.08);
  --ps-bg-a: rgba(14, 110, 232, 0.12);
  --ps-bg-b: rgba(10, 143, 131, 0.1);
  --ps-bg-c: rgba(52, 70, 130, 0.1);
  --ps-cosmos-bg-a: #051b37;
  --ps-cosmos-bg-b: #09294f;
  --ps-cosmos-bg-c: #061126;
  --ps-cosmos-nebula-a: rgba(58, 164, 255, 0.34);
  --ps-cosmos-nebula-b: rgba(48, 233, 255, 0.2);
  --ps-cosmos-note: rgba(207, 228, 246, 0.92);
  color: var(--ps-text);
  position: relative;
  min-height: 100%;
  height: 100%;
  padding: clamp(18px, 2vw, 28px);
}

body[data-theme="dark"] .portal-search-app {
  --ps-card-bg: rgba(8, 23, 40, 0.7);
  --ps-card-bg-strong: rgba(9, 26, 45, 0.88);
  --ps-soft-bg: rgba(9, 26, 45, 0.68);
  --ps-input-bg: rgba(7, 27, 46, 0.88);
  --ps-preview-modal-bg: #0b2238;
  --ps-preview-surface: #102b43;
  --ps-preview-surface-soft: #0c2439;
  --ps-preview-stage-dark: #0f273d;
  --ps-overlay-bg: rgba(3, 10, 20, 0.56);
  --ps-shadow: 0 22px 44px rgba(2, 8, 18, 0.42);
  --ps-modal-shadow: 0 26px 56px rgba(2, 8, 18, 0.64);
  --ps-grid-line: rgba(161, 198, 240, 0.08);
  --ps-bg-a: rgba(70, 137, 255, 0.16);
  --ps-bg-b: rgba(52, 208, 191, 0.14);
  --ps-bg-c: rgba(156, 126, 255, 0.12);
  --ps-cosmos-bg-a: #041224;
  --ps-cosmos-bg-b: #092344;
  --ps-cosmos-bg-c: #030a16;
  --ps-cosmos-nebula-a: rgba(74, 152, 255, 0.3);
  --ps-cosmos-nebula-b: rgba(50, 222, 255, 0.18);
  --ps-cosmos-note: rgba(184, 214, 241, 0.9);
}

.portal-search-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.portal-search-bg::before {
  content: "";
  position: absolute;
  inset: -34% -28%;
  background:
    radial-gradient(circle at 22% 78%, var(--ps-bg-a) 0%, transparent 46%),
    radial-gradient(circle at 78% 20%, var(--ps-bg-b) 0%, transparent 48%),
    radial-gradient(circle at 56% 44%, var(--ps-bg-c) 0%, transparent 44%);
  animation: portal-search-bg-drift 22s ease-in-out infinite;
}

.portal-search-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--ps-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ps-grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 82%);
}

@keyframes portal-search-bg-drift {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(2%, 2%) rotate(1deg);
  }
  66% {
    transform: translate(-1.5%, 1%) rotate(-1deg);
  }
}

.portal-search-container {
  width: min(980px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portal-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-search-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 0.9rem + 0.52vw, 1.34rem);
  font-weight: 700;
}

.portal-search-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--ps-accent-strong), var(--ps-accent));
}

.portal-search-settings-btn,
.portal-search-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--ps-border);
  background: var(--ps-soft-bg);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.portal-search-settings-btn:hover,
.portal-search-close-btn:hover {
  border-color: var(--ps-border-strong);
  background: var(--ps-card-bg-strong);
}

.portal-search-settings-btn:active,
.portal-search-close-btn:active {
  transform: scale(0.97);
}

.portal-search-settings-btn {
  position: relative;
}

.portal-search-settings-btn::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  background: var(--ps-card-bg-strong);
  color: var(--ps-text);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
  padding: 6px 10px;
  box-shadow: var(--ps-modal-shadow);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 50;
}

.portal-search-settings-btn:hover::after,
.portal-search-settings-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.portal-search-main-card {
  border: 1px solid var(--ps-border);
  border-radius: 22px;
  background: var(--ps-card-bg);
  box-shadow: var(--ps-shadow);
  backdrop-filter: blur(10px);
  padding: clamp(14px, 1.8vw, 24px);
  position: relative;
  z-index: 8;
}

.portal-search-app.is-local-mode .portal-search-main-card {
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.portal-search-app.is-local-mode .portal-search-main-card::-webkit-scrollbar {
  width: 8px;
}

.portal-search-app.is-local-mode .portal-search-main-card::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(76, 150, 255, 0.12);
}

.portal-search-app.is-local-mode .portal-search-main-card::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(76, 150, 255, 0.55);
}

.portal-search-app.is-local-mode .portal-search-result-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.portal-search-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-search-toolbar > .portal-search-logo {
  justify-self: start;
}

.portal-search-toolbar > .portal-search-mode-switch {
  justify-self: center;
}

.portal-search-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  justify-self: end;
}

.portal-search-mode-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--ps-border);
  background: var(--ps-soft-bg);
}

.portal-search-mode-btn {
  border: 0;
  background: transparent;
  color: var(--ps-text-muted);
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.portal-search-mode-btn:hover {
  color: var(--ps-text);
}

.portal-search-mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.portal-search-mode-btn.active {
  color: var(--ps-text);
  background: linear-gradient(135deg, rgba(76, 150, 255, 0.28), rgba(10, 143, 131, 0.24));
}

.portal-search-support-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--ps-border);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.portal-search-support-badge.ok {
  color: #0f7f4e;
  background: rgba(74, 204, 129, 0.2);
  border-color: rgba(74, 204, 129, 0.42);
}

.portal-search-support-badge.warn {
  color: #8c5a0f;
  background: rgba(255, 181, 85, 0.22);
  border-color: rgba(255, 181, 85, 0.42);
}

body[data-theme="dark"] .portal-search-support-badge.ok {
  color: #b7f3c6;
}

body[data-theme="dark"] .portal-search-support-badge.warn {
  color: #ffd8a8;
}

.portal-search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
  gap: 10px;
}

.portal-search-input-wrapper {
  position: relative;
  display: flex;
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  background: var(--ps-input-bg);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-search-input-wrapper:focus-within {
  border-color: var(--ps-accent-strong);
  box-shadow: 0 0 0 3px rgba(76, 150, 255, 0.2);
}

.portal-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ps-text-muted);
  pointer-events: none;
  display: inline-flex;
}

.portal-search-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px 0 42px;
  border: 0;
  background: transparent;
  color: var(--ps-text);
  font-family: inherit;
  font-size: 1rem;
}

.portal-search-input::placeholder {
  color: var(--ps-text-muted);
}

.portal-search-input:focus {
  outline: none;
}

.portal-search-engine-dropdown {
  position: relative;
  display: flex;
  z-index: 36;
}

.portal-search-engine-dropdown.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.portal-search-engine-dropdown-btn {
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  background: var(--ps-soft-bg);
  color: inherit;
  min-width: 116px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.portal-search-engine-dropdown-arrow {
  transition: transform 0.2s ease;
}

.portal-search-engine-dropdown.open .portal-search-engine-dropdown-arrow {
  transform: rotate(180deg);
}

.portal-search-engine-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 120px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: var(--ps-card-bg-strong);
  box-shadow: var(--ps-modal-shadow);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 120;
}

.portal-search-engine-dropdown.open .portal-search-engine-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.portal-search-engine-dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ps-text-muted);
  text-align: left;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
}

.portal-search-engine-dropdown-item:hover {
  background: rgba(76, 150, 255, 0.12);
  color: var(--ps-text);
}

.portal-search-engine-dropdown-item:focus-visible {
  outline: 2px solid rgba(76, 150, 255, 0.5);
  outline-offset: 1px;
  background: rgba(76, 150, 255, 0.14);
  color: var(--ps-text);
}

.portal-search-engine-dropdown-item.active {
  background: linear-gradient(135deg, rgba(76, 150, 255, 0.28), rgba(10, 143, 131, 0.24));
  color: var(--ps-text);
}

.portal-search-btn {
  position: relative;
  border: 0;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ps-accent-strong), var(--ps-accent));
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
  flex-shrink: 0;
}

.portal-search-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.portal-search-btn:hover {
  filter: saturate(1.08);
}

.portal-search-btn:active {
  transform: translateY(1px);
}

.portal-search-btn::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  background: var(--ps-card-bg-strong);
  color: var(--ps-text);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
  padding: 6px 10px;
  box-shadow: var(--ps-modal-shadow);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 50;
}

.portal-search-btn:hover::after,
.portal-search-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.portal-search-active-context {
  margin: 10px 0 0;
  border: 1px dashed var(--ps-border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.78rem;
  color: var(--ps-text-muted);
  background: var(--ps-soft-bg);
}

.portal-search-active-context[data-mode="local"] {
  border-color: rgba(76, 150, 255, 0.35);
  color: var(--ps-text);
}

.portal-search-notice {
  margin: 10px 0 0;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ps-text-muted);
  background: var(--ps-soft-bg);
}

.portal-search-notice.is-info {
  border-color: rgba(76, 150, 255, 0.34);
  background: rgba(76, 150, 255, 0.12);
  color: var(--ps-text);
}

.portal-search-notice.is-success {
  border-color: rgba(39, 147, 91, 0.36);
  background: rgba(39, 147, 91, 0.14);
  color: #14663f;
}

.portal-search-notice.is-error {
  border-color: rgba(210, 56, 56, 0.36);
  background: rgba(210, 56, 56, 0.13);
  color: #a43838;
}

body[data-theme="dark"] .portal-search-notice.is-success {
  color: #b8f3d4;
}

body[data-theme="dark"] .portal-search-notice.is-error {
  color: #ffb7b7;
}

.portal-search-site-panel {
  margin-top: 14px;
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  background: var(--ps-soft-bg);
  padding: 12px;
}

.portal-search-site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.portal-search-site-title {
  font-size: 1.02rem;
  font-weight: 700;
}

.portal-search-site-meta {
  font-size: 0.76rem;
  color: var(--ps-text-muted);
}

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

.portal-search-site-card {
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: var(--ps-card-bg-strong);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.portal-search-site-card h4 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 650;
  color: var(--ps-text-muted);
}

.portal-search-site-value {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.portal-search-site-value strong {
  font-size: 1.18rem;
  line-height: 1;
  font-weight: 760;
}

.portal-search-site-value span {
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--ps-text-muted);
}

.portal-search-cosmos-panel {
  margin-top: 0;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  min-height: clamp(280px, 45vh, 560px);
  height: auto;
  max-height: none;
  position: relative;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.portal-search-cosmos-panel::before {
  content: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.portal-search-cosmos-canvas {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: block;
  cursor: default;
  touch-action: none;
  user-select: none;
  pointer-events: none;
}

.portal-search-cosmos-canvas.is-dragging {
  cursor: default;
}

.portal-search-cosmos-note {
  display: none;
}

body.portal-cosmos-shortcut-active {
  overflow: hidden;
}

body.portal-cosmos-shortcut-active #portalSearchCanvas {
  position: fixed;
  inset: 0;
  z-index: 1400;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
}

body.portal-cosmos-shortcut-active #portalSearchRoot {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  background: rgba(7, 20, 42, 0.08);
  backdrop-filter: blur(8px) saturate(116%);
  -webkit-backdrop-filter: blur(8px) saturate(116%);
}

body.portal-cosmos-shortcut-active #portalSearchRoot > :not(.portal-search-container) {
  display: none !important;
}

body.portal-cosmos-shortcut-active #portalSearchRoot .portal-search-container {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  display: block;
  position: relative;
}

body.portal-cosmos-shortcut-active #portalSearchRoot .portal-search-main-card {
  display: none !important;
}

body.portal-cosmos-shortcut-active #portalSearchCosmosPanel {
  position: absolute;
  inset: 0;
  min-height: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  pointer-events: none;
}

body.portal-cosmos-shortcut-active #portalSearchCosmosPanel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(7, 18, 40, 0.2), rgba(6, 16, 36, 0.36));
  pointer-events: none;
}

body.portal-cosmos-shortcut-active #portalSearchCosmosPanel .portal-search-cosmos-note {
  display: block;
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(6, 16, 38, 0.42);
  color: rgba(226, 241, 255, 0.92);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.portal-search-local-panel {
  margin-top: 14px;
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  background: var(--ps-soft-bg);
  padding: 12px;
  display: none;
}

.portal-search-local-panel.is-active {
  display: block;
}

.portal-search-local-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-search-local-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.portal-search-local-status {
  font-size: 0.78rem;
  color: var(--ps-text-muted);
}

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

.portal-search-small-btn {
  border: 1px solid var(--ps-border);
  background: var(--ps-card-bg-strong);
  color: inherit;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.portal-search-small-btn.is-warn {
  border-color: rgba(210, 56, 56, 0.35);
  background: rgba(210, 56, 56, 0.12);
  color: #a43838;
}

body[data-theme="dark"] .portal-search-small-btn.is-warn {
  color: #ffb7b7;
}

.portal-search-small-btn.is-warn.is-armed {
  border-color: rgba(210, 56, 56, 0.75);
  background: rgba(210, 56, 56, 0.22);
  color: #8f1818;
  box-shadow: 0 0 0 1px rgba(210, 56, 56, 0.24) inset;
}

body[data-theme="dark"] .portal-search-small-btn.is-warn.is-armed {
  border-color: rgba(255, 132, 132, 0.85);
  background: rgba(210, 56, 56, 0.34);
  color: #ffd9d9;
}

.portal-search-small-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.portal-search-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(76, 150, 255, 0.18);
  margin-top: 10px;
  overflow: hidden;
}

.portal-search-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--ps-accent-strong), var(--ps-accent));
  transition: width 0.22s ease;
}

.portal-search-index-report {
  margin-top: 10px;
  border: 1px dashed var(--ps-border);
  border-radius: 10px;
  background: var(--ps-card-bg-strong);
  padding: 10px;
  position: relative;
}

.portal-search-index-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-search-index-report-title {
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-search-index-report-note {
  font-size: 0.72rem;
  color: var(--ps-text-muted);
}

.portal-search-index-report-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.portal-search-index-report-item {
  border: 1px solid var(--ps-border);
  border-radius: 8px;
  background: var(--ps-soft-bg);
  min-height: 52px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.portal-search-index-report-item span {
  font-size: 0.7rem;
  color: var(--ps-text-muted);
  line-height: 1.3;
}

.portal-search-index-report-item strong {
  font-size: 1rem;
  line-height: 1.1;
  font-weight: 750;
}

.portal-search-index-report-item.has-detail {
  cursor: pointer;
}

.portal-search-index-report-item.has-detail:hover,
.portal-search-index-report-item.has-detail.is-active {
  border-color: var(--ps-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ps-accent) 48%, transparent);
}

.portal-search-index-report-hover {
  position: absolute;
  z-index: 12;
  width: min(460px, calc(100vw - 44px));
  max-height: 270px;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: #ffffff;
  color: #132c46;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  padding: 10px;
  overflow: hidden;
}

.portal-search-index-report-hover-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 6px;
}

.portal-search-index-report-hover-head strong {
  font-size: 0.88rem;
  line-height: 1.3;
  color: inherit;
}

.portal-search-index-report-hover-body {
  max-height: 212px;
  overflow: auto;
  padding-right: 2px;
}

.portal-search-index-report-hover-empty {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ps-text-muted);
  line-height: 1.5;
}

.portal-search-index-report-hover-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.portal-search-index-report-hover-item {
  border: 0;
  border-bottom: 1px dashed var(--ps-border);
  background: transparent;
  padding: 6px 0;
}

.portal-search-index-report-hover-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
  word-break: break-all;
}

.portal-search-index-report-hover-item-path {
  display: none;
}

.portal-search-index-report-hover-item-meta {
  display: none;
}

body[data-theme="dark"] .portal-search-index-report-hover {
  background: #10273e;
  color: #e8f2ff;
  border-color: rgba(167, 205, 245, 0.32);
  box-shadow: 0 18px 36px rgba(2, 8, 18, 0.56);
}

@media (max-width: 900px) {
  .portal-search-index-report-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .portal-search-index-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .portal-search-index-report-grid {
    grid-template-columns: 1fr;
  }
}

.portal-search-support-note {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--ps-text-muted);
}

.portal-search-result-panel {
  margin-top: 14px;
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  background: var(--ps-soft-bg);
  padding: 12px;
  display: none;
}

.portal-search-result-panel.show {
  display: block;
}

.portal-search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ps-text-muted);
  margin-bottom: 8px;
}

.portal-search-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
  overflow: auto;
  padding-right: 4px;
}

.portal-search-result-item {
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-card-bg-strong);
  padding: 10px;
}

.portal-search-result-name {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.portal-search-result-path {
  color: var(--ps-text-muted);
  font-size: 0.76rem;
  word-break: break-all;
  margin-bottom: 4px;
}

.portal-search-result-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.portal-search-result-source-tag {
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--ps-text-muted);
  background: var(--ps-soft-bg);
}

.portal-search-result-meta {
  color: var(--ps-text-muted);
  font-size: 0.74rem;
}

.portal-search-result-highlight {
  border-radius: 4px;
  padding: 0 1px;
  background: rgba(255, 214, 74, 0.58);
  color: inherit;
}

body[data-theme="dark"] .portal-search-result-highlight {
  background: rgba(255, 171, 25, 0.62);
}

.portal-search-result-empty {
  border: 1px dashed var(--ps-border);
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
  color: var(--ps-text-muted);
  font-size: 0.84rem;
}

.portal-search-result-state {
  border: 1px dashed var(--ps-border);
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
  color: var(--ps-text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.portal-search-result-state.is-loading {
  border-style: solid;
  border-color: rgba(76, 150, 255, 0.36);
  background: rgba(76, 150, 255, 0.1);
  color: var(--ps-text);
}

.portal-search-result-state.is-error {
  border-style: solid;
  border-color: rgba(210, 56, 56, 0.36);
  background: rgba(210, 56, 56, 0.1);
  color: #a43838;
}

body[data-theme="dark"] .portal-search-result-state.is-error {
  color: #ffb7b7;
}

.portal-search-result-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.portal-search-result-list::-webkit-scrollbar,
.portal-search-engine-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.portal-search-result-list::-webkit-scrollbar-track,
.portal-search-engine-dropdown-menu::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(76, 150, 255, 0.12);
}

.portal-search-result-list::-webkit-scrollbar-thumb,
.portal-search-engine-dropdown-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(76, 150, 255, 0.55);
}

.portal-search-settings-overlay,
.portal-search-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--ps-overlay-bg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.portal-search-settings-overlay.is-open,
.portal-search-preview-overlay.is-open {
  opacity: 1;
}

.portal-search-settings-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(420px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  max-height: min(calc(100% - 24px), calc(100dvh - 24px));
  z-index: 21;
  border: 1px solid var(--ps-border);
  border-left: 1px solid var(--ps-border);
  border-radius: 16px;
  background: var(--ps-card-bg-strong);
  backdrop-filter: blur(14px);
  box-shadow: -14px 0 30px rgba(8, 30, 56, 0.22);
  padding: 14px 14px 16px;
  transform: translateX(100%);
  transition: transform 0.24s ease;
  overflow-y: auto;
}

.portal-search-settings-panel.is-open {
  transform: translateX(0);
}

.portal-search-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.portal-search-settings-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.portal-search-settings-section {
  margin-bottom: 12px;
}

.portal-search-settings-section-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ps-text-muted);
}

.portal-search-engine-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portal-search-engine-item {
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-soft-bg);
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-search-engine-item-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.portal-search-custom-badge {
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--ps-text-muted);
}

.portal-search-engine-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portal-search-delete-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(210, 56, 56, 0.35);
  border-radius: 8px;
  background: rgba(210, 56, 56, 0.12);
  color: #c64242;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body[data-theme="dark"] .portal-search-delete-btn {
  color: #ff8f8f;
}

.portal-search-add-engine-form {
  display: grid;
  gap: 6px;
}

.portal-search-form-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.84rem;
  color: inherit;
  background: var(--ps-input-bg);
}

.portal-search-form-input:focus {
  outline: none;
  border-color: var(--ps-accent-strong);
  box-shadow: 0 0 0 2px rgba(76, 150, 255, 0.2);
}

.portal-search-form-hint {
  font-size: 0.74rem;
  color: var(--ps-text-muted);
  line-height: 1.45;
}

.portal-search-form-btn {
  width: 44px;
  height: 44px;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  padding: 0;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--ps-accent-strong), var(--ps-accent));
  cursor: pointer;
}

.portal-search-empty-text {
  margin: 0;
  border: 1px dashed var(--ps-border);
  border-radius: 10px;
  padding: 12px 10px;
  color: var(--ps-text-muted);
  font-size: 0.84rem;
}

.portal-search-preview-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(760px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  z-index: 22;
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  background: var(--ps-preview-modal-bg);
  box-shadow: var(--ps-modal-shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.portal-search-preview-modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.portal-search-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--ps-border);
}

.portal-search-preview-title {
  font-size: 0.88rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-search-preview-body {
  padding: 10px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  background: var(--ps-preview-modal-bg);
}

.portal-search-preview-meta {
  margin: 0;
  color: var(--ps-text-muted);
  font-size: 0.78rem;
}

.portal-search-preview-empty {
  margin: 0;
  color: var(--ps-text-muted);
  font-size: 0.84rem;
}

.portal-search-preview-content {
  display: grid;
  align-content: start;
  gap: 8px;
}

.portal-search-preview-open-card {
  width: 100%;
  min-height: 160px;
  border: 1px dashed var(--ps-border);
  border-radius: 10px;
  background: var(--ps-preview-surface);
  color: inherit;
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  padding: 12px;
}

.portal-search-preview-image-stage {
  width: 100%;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-preview-stage-dark);
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.portal-search-preview-image {
  width: 100%;
  max-height: min(560px, calc(100vh - 250px));
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.portal-search-preview-image-hint,
.portal-search-preview-doc-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--ps-text-muted);
}

.portal-search-preview-frame-wrap {
  width: 100%;
  height: min(560px, calc(100vh - 260px));
  min-height: 220px;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-preview-surface);
  overflow: hidden;
}

.portal-search-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

body[data-theme="dark"] .portal-search-preview-frame {
  background: #0c2439;
}

.portal-search-preview-media {
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-preview-stage-dark);
  overflow: hidden;
}

.portal-search-preview-video {
  width: 100%;
  height: 100%;
}

.portal-search-preview-audio-wrap {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-preview-surface);
}

.portal-search-preview-text-stage,
.portal-search-preview-markdown-stage {
  width: 100%;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-preview-surface);
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.portal-search-preview-text {
  margin: 0;
  padding: 12px;
  min-height: 180px;
  max-height: min(560px, calc(100vh - 300px));
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.portal-search-preview-markdown {
  margin: 0;
  padding: 12px;
  min-height: 180px;
  max-height: min(560px, calc(100vh - 300px));
  overflow: auto;
  line-height: 1.7;
  word-break: break-word;
}

.portal-search-preview-markdown > *:first-child {
  margin-top: 0;
}

.portal-search-preview-markdown > *:last-child {
  margin-bottom: 0;
}

.portal-search-preview-markdown pre {
  margin: 0.7em 0;
  overflow: auto;
  background: var(--ps-preview-surface-soft);
  border: 1px solid var(--ps-border);
  border-radius: 8px;
  padding: 10px;
  white-space: pre;
}

.portal-search-preview-markdown code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92em;
}

.portal-search-preview-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
}

.portal-search-preview-markdown th,
.portal-search-preview-markdown td {
  border: 1px solid var(--ps-border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.portal-search-preview-markdown img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

body[data-theme="dark"] .portal-search-preview-open-card,
body[data-theme="dark"] .portal-search-preview-text-stage,
body[data-theme="dark"] .portal-search-preview-markdown-stage,
body[data-theme="dark"] .portal-search-preview-audio-wrap,
body[data-theme="dark"] .portal-search-preview-frame-wrap {
  background: var(--ps-preview-surface);
}

body[data-theme="dark"] .portal-search-preview-markdown pre {
  background: var(--ps-preview-surface-soft);
}

@media (max-width: 980px) {
  .portal-search-toolbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .portal-search-toolbar > .portal-search-logo,
  .portal-search-toolbar > .portal-search-mode-switch,
  .portal-search-toolbar > .portal-search-toolbar-right {
    justify-self: center;
  }

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

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

  .portal-search-cosmos-panel {
    min-height: clamp(220px, 40vh, 420px);
    height: auto;
    max-height: none;
  }

  .portal-search-engine-dropdown {
    width: 100%;
  }

  .portal-search-engine-dropdown-btn {
    min-height: 44px;
  }

  .portal-search-btn {
    width: 44px;
    height: 44px;
    justify-self: end;
  }
}

@media (max-width: 720px) {
  .portal-search-app {
    padding: 10px;
  }

  .portal-search-main-card {
    border-radius: 16px;
    padding: 12px;
  }

  .portal-search-settings-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100% - 16px);
    max-height: min(calc(100% - 16px), calc(100dvh - 16px));
    border-left: 1px solid var(--ps-border);
    border-radius: 14px;
    padding: 12px;
  }

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

  .portal-search-cosmos-panel {
    min-height: clamp(180px, 34vh, 300px);
    height: auto;
    max-height: none;
  }

}

@media (max-height: 760px) {
  .portal-search-settings-panel {
    top: 8px;
    right: 8px;
    width: min(420px, calc(100% - 16px));
    max-height: calc(100% - 16px);
    max-height: min(calc(100% - 16px), calc(100dvh - 16px));
    padding: 12px;
  }

  .portal-search-settings-header {
    margin-bottom: 10px;
  }
}

body[data-main-view="search"] .content > .portal-search-canvas {
  width: min(1480px, 100%);
}

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

.panel-grid.recommend-only #recommendPanel {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body[data-main-view="recommend"] .content > .panel-grid.recommend-only,
body[data-main-view="internal"] .content > .panel-grid.recommend-only,
body[data-main-view="website"] .content > .panel-grid.recommend-only,
body[data-main-view="favorites"] .content > .panel-grid.recommend-only,
body[data-main-view="vault"] .content > .panel-grid.recommend-only,
body[data-main-view="tutorial"] .content > .panel-grid.recommend-only,
body[data-main-view="tasks"] .content > .panel-grid.recommend-only,
body[data-main-view="local"] .content > .panel-grid.recommend-only,
body[data-main-view="notes"] .content > .panel-grid.recommend-only,
body[data-main-view="ai"] .content > .panel-grid.recommend-only {
  width: min(1480px, 100%);
}

.panel {
  padding: clamp(14px, 1.8vw, 20px);
}

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

.panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.2;
}

.panel-head button {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  min-height: 32px;
  padding: 0 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

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

.task-list li {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16));
  padding: 11px 12px;
}

.task-list strong {
  display: block;
  font-size: var(--step-0);
}

.task-list span {
  display: block;
  margin-top: 5px;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.view-search-toolbar {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16));
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  margin: 0;
}

.topbar-view-search {
  flex: 0 1 min(48vw, 700px);
  min-width: clamp(260px, 26vw, 420px);
  border-radius: 14px;
  padding: 6px 8px;
  gap: 4px;
}

.topbar-network-image-search {
  flex-basis: min(34vw, 480px);
  min-width: clamp(220px, 22vw, 360px);
}

.topbar-website-search {
  flex-basis: min(36vw, 520px);
  min-width: clamp(220px, 22vw, 360px);
}

.view-search-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.topbar-tasks-search .view-search-input-wrap {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.topbar-ai-search .view-search-input-wrap {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.topbar-tasks-search .tasks-search-transfer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-tasks-search .tasks-search-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--chip-bg);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.topbar-tasks-search .tasks-search-action svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-tasks-search .tasks-search-action::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translate(-50%, -4px);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-bg-strong);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
  padding: 6px 10px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 60;
}

.topbar-tasks-search .tasks-search-action:hover::after,
.topbar-tasks-search .tasks-search-action:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.topbar-tasks-search .tasks-search-action:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.topbar-tasks-search .tasks-search-action:disabled::after {
  display: none;
}

.topbar-tasks-search .tasks-search-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-tasks-search .tasks-search-nav button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-tasks-search .tasks-search-nav button svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-tasks-search .tasks-search-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.view-search-input-wrap input,
.view-search-input-wrap select {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 0 12px;
  font-family: inherit;
  font-size: var(--step--1);
}

.view-search-input-wrap input:focus,
.view-search-input-wrap select:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.view-search-input-wrap button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  padding: 0 12px;
  cursor: pointer;
}

.view-search-input-wrap button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.view-search-meta {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.76rem;
  line-height: 1.3;
}

.recommend-category-grid {
  --recommend-item-row-height: 70px;
  --recommend-item-gap: 8px;
  --recommend-visible-rows: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.recommend-category-grid.mode-internal {
  --recommend-item-row-height: 62px;
  --recommend-visible-rows: 6;
  grid-template-columns: minmax(0, 1fr);
}

.recommend-category-grid.mode-internal .recommend-items-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.recommend-category {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.16));
  padding: 14px 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: clamp(304px, 33vh, 388px);
  overflow: hidden;
}

.recommend-category-grid.mode-internal .recommend-category {
  min-height: clamp(620px, 76vh, 860px);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.recommend-category-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
}

.recommend-items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: var(--recommend-item-row-height);
  gap: var(--recommend-item-gap);
  max-height: calc(
    var(--recommend-item-row-height) * var(--recommend-visible-rows) +
      var(--recommend-item-gap) * (var(--recommend-visible-rows) - 1)
  );
  padding-right: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.56) rgba(255, 255, 255, 0.14);
}

.recommend-items-grid::-webkit-scrollbar {
  width: 8px;
}

.recommend-items-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.recommend-items-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(39, 130, 188, 0.72), rgba(31, 99, 168, 0.68));
}

.recommend-items-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(49, 151, 210, 0.84), rgba(35, 113, 188, 0.78));
}

.recommend-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.14));
  min-height: 0;
  height: 100%;
  padding: 8px 10px;
  display: grid;
  align-content: start;
  gap: 2px;
}

.recommend-item strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.2;
}

.recommend-item span {
  color: var(--text-subtle);
  font-size: 0.86rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommend-link {
  display: block;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommend-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.protected-feature-center,
.notes-center {
  width: 100%;
  min-height: clamp(560px, 72vh, 860px);
  display: grid;
  align-content: start;
  gap: 12px;
}

.notes-auth-card,
.notes-workspace {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16));
  padding: 12px;
}

.protected-feature-auth {
  min-height: clamp(620px, 74vh, 860px);
}

.notes-auth-placeholder {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16));
  min-height: clamp(620px, 74vh, 860px);
  padding: 18px;
  display: grid;
  place-items: center;
}

.network-image-canvas {
  --network-card-gap: 12px;
  --network-canvas-padding: 12px;
  --network-column-count: 6;
  width: min(1520px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.12));
  padding: var(--network-canvas-padding);
  height: clamp(620px, 74vh, 860px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(49, 127, 185, 0.56) rgba(255, 255, 255, 0.12);
}

.network-image-canvas::-webkit-scrollbar {
  width: 8px;
}

.network-image-canvas::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.network-image-canvas::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(68, 146, 202, 0.72), rgba(39, 114, 172, 0.66));
  border-radius: 999px;
}

.network-image-canvas::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(80, 160, 220, 0.78), rgba(48, 128, 190, 0.7));
}

.network-image-grid {
  column-count: var(--network-column-count);
  column-gap: var(--network-card-gap);
}

.network-image-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-bg-strong);
  padding: 8px;
  display: block;
  margin: 0 0 var(--network-card-gap);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  cursor: zoom-in;
}

.network-image-thumb {
  border-radius: 8px;
  overflow: hidden;
  background: rgba(10, 20, 35, 0.08);
  display: block;
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.network-image-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.network-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.72rem;
}

@media (max-width: 1600px) {
  .network-image-canvas {
    --network-column-count: 5;
  }

  .website-collection-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .network-image-canvas {
    --network-column-count: 4;
  }

  .website-collection-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .network-image-canvas {
    --network-column-count: 3;
    height: clamp(520px, 70vh, 760px);
  }

  .website-collection-canvas {
    min-height: clamp(460px, 62vh, 680px);
  }

  .website-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .network-image-canvas {
    --network-column-count: 2;
  }

  .website-collection-canvas .website-collection-tags-shell.is-scrollable {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    gap: 6px;
  }

  .website-collection-canvas .website-collection-tags-nav {
    width: 28px;
    height: 28px;
    min-height: 28px;
  }

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

@media (max-width: 460px) {
  .network-image-canvas {
    --network-column-count: 1;
  }

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

.network-image-type {
  color: var(--accent-strong);
  font-weight: 700;
  background: rgba(14, 110, 232, 0.12);
  border-radius: 999px;
  padding: 2px 6px;
}

.network-image-note {
  color: var(--text-subtle);
  flex: 1;
  min-width: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-image-empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-subtle);
  font-size: var(--step--1);
  pointer-events: none;
}

.network-image-modal {
  width: min(234px, 42.3vw);
  display: grid;
  gap: 12px;
}

.network-image-form textarea {
  min-height: 64px;
}

.network-image-form button {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.network-image-status {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.network-image-status.is-error {
  color: #cf3c4f;
}

.protected-feature-workspace {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.16));
  min-height: clamp(620px, 74vh, 860px);
  padding: clamp(18px, 2.4vw, 28px);
  display: grid;
  place-items: center;
}

#aiWorkspace.protected-feature-workspace {
  border: 0;
  background: transparent;
  padding: 0;
}

#vaultWorkspace.protected-feature-workspace {
  place-items: start center;
}

.protected-feature-workspace-inner {
  max-width: min(560px, 100%);
  text-align: center;
}

.protected-feature-workspace-inner h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.2;
}

.protected-feature-workspace-inner p {
  margin: 10px 0 0;
  color: var(--text-subtle);
  font-size: var(--step-0);
  line-height: 1.5;
}

.protected-feature-workspace-inner.protected-data-layout.vault-file-canvas {
  --vault-panel-height: clamp(500px, 66vh, 720px);
  width: min(1420px, 100%);
  max-width: min(1420px, 100%);
  text-align: left;
  display: grid;
  gap: 14px;
}

.vault-file-hero {
  display: grid;
  gap: 6px;
}

.vault-file-layout {
  display: grid;
  grid-template-columns: minmax(320px, 38fr) minmax(420px, 62fr);
  gap: 12px;
  align-items: stretch;
  min-height: 0;
}

.vault-file-hero h3 {
  margin: 0;
}

.vault-file-brand {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-subtle);
}

.vault-file-subtitle {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.92rem;
  line-height: 1.45;
}

.vault-file-storage-line {
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vault-file-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 650;
  background: var(--chip-bg);
  color: var(--text-main);
}

.vault-file-badge.ok {
  border-color: rgba(10, 143, 131, 0.45);
  background: rgba(10, 143, 131, 0.14);
  color: #0f7063;
}

.vault-file-badge.warn {
  border-color: rgba(184, 127, 11, 0.48);
  background: rgba(236, 185, 46, 0.16);
  color: #87590f;
}

.vault-file-storage-usage {
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.vault-file-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.18));
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 0;
}

.vault-file-card-list,
.vault-preview-card {
  height: var(--vault-panel-height);
}

.vault-file-card-list {
  grid-template-rows: auto minmax(0, 1fr);
}

.vault-preview-card {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.vault-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.vault-preview-head h4 {
  margin: 0;
  font-size: var(--step-0);
}

.vault-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vault-preview-search-hint {
  color: var(--text-subtle);
  font-size: 0.74rem;
  line-height: 1.4;
}

.vault-preview-actions button {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  padding: 0 10px;
  cursor: pointer;
}

.vault-preview-actions button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.vault-preview-meta {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.8rem;
  line-height: 1.4;
}

.vault-preview-body {
  min-height: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  overflow: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.vault-preview-empty {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.88rem;
}

.vault-preview-open-card {
  width: 100%;
  min-height: 180px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.5;
  cursor: pointer;
  padding: 14px;
}

.vault-preview-image-stage {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(8, 18, 29, 0.88);
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.vault-preview-image {
  width: 100%;
  max-height: calc(var(--vault-panel-height) - 180px);
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.vault-preview-image-hint,
.vault-preview-doc-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.vault-preview-media {
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(8, 18, 29, 0.88);
  overflow: hidden;
}

.vault-preview-video {
  width: 100%;
  height: 100%;
}

.vault-preview-audio-wrap {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.vault-preview-text-stage {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.52);
  color: inherit;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.vault-preview-markdown-stage {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.52);
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.vault-preview-text {
  margin: 0;
  padding: 12px;
  min-height: 220px;
  max-height: calc(var(--vault-panel-height) - 220px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.58;
}

.vault-preview-markdown {
  margin: 0;
  padding: 12px;
  min-height: 220px;
  max-height: calc(var(--vault-panel-height) - 220px);
  overflow: auto;
  line-height: 1.7;
  word-break: break-word;
}

.vault-preview-markdown > *:first-child {
  margin-top: 0;
}

.vault-preview-markdown > *:last-child {
  margin-bottom: 0;
}

.vault-preview-markdown pre {
  margin: 0.7em 0;
  overflow: auto;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  white-space: pre;
}

.vault-preview-markdown code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92em;
}

.vault-preview-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
}

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

.vault-preview-markdown img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.vault-preview-text mark.notice-highlight {
  background: rgba(255, 214, 74, 0.54);
  color: inherit;
  border-radius: 3px;
  padding: 0;
}

.vault-preview-body mark.notice-highlight.is-search-focus {
  background: rgba(255, 171, 25, 0.72);
}

.vault-preview-frame-wrap {
  width: 100%;
  height: min(520px, calc(var(--vault-panel-height) - 130px));
  min-height: 190px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.vault-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.vault-preview-ppt-stage {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.vault-preview-ppt-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vault-preview-ppt-toolbar button {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  padding: 0 10px;
  cursor: pointer;
}

.vault-preview-ppt-toolbar button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.vault-preview-ppt-indicator {
  font-size: 0.8rem;
  margin-left: 2px;
}

.vault-preview-ppt-status {
  font-size: 0.76rem;
  color: var(--text-subtle);
}

.vault-preview-ppt-canvas-wrap {
  width: 100%;
  min-height: 220px;
  max-height: calc(var(--vault-panel-height) - 180px);
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
}

.vault-preview-ppt-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: #fff;
}

.vault-file-import-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vault-file-button,
.vault-file-ghost,
.vault-file-actions button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  padding: 0 12px;
  cursor: pointer;
}

.vault-file-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.vault-file-drop-zone {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  min-height: 92px;
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.44);
  text-align: center;
  padding: 10px;
}

.vault-file-drop-zone.active {
  border-color: rgba(14, 110, 232, 0.58);
  background: rgba(223, 237, 255, 0.56);
  color: var(--text-main);
}

.vault-file-tip {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.78rem;
  line-height: 1.45;
}

.vault-file-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vault-file-list-head h4 {
  margin: 0;
  font-size: var(--step-0);
}

.vault-file-list-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.vault-file-list-head span {
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.vault-file-list {
  display: grid;
  gap: 8px;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 2px;
}

.vault-file-empty {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.88rem;
}

.vault-file-item {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.vault-file-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.vault-file-name {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.35;
  word-break: break-word;
}

.vault-file-info {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.76rem;
  line-height: 1.35;
  word-break: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-file-meta mark.notice-highlight {
  background: rgba(255, 214, 74, 0.54);
  color: inherit;
  border-radius: 4px;
  padding: 0;
}

.vault-file-meta mark.notice-highlight.is-search-focus {
  background: rgba(255, 171, 25, 0.72);
}

.vault-file-item.is-search-focus {
  border-color: rgba(14, 110, 232, 0.52);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.2);
}

.vault-file-item.is-preview-selected {
  border-color: rgba(19, 129, 215, 0.56);
  box-shadow: inset 0 0 0 1px rgba(19, 129, 215, 0.2);
}

.vault-file-actions {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.vault-file-actions button {
  flex: 0 0 auto;
  min-height: 30px;
  border-radius: 9px;
  padding: 0 10px;
  font-size: 0.74rem;
}

.vault-file-actions button.danger {
  border-color: rgba(201, 84, 84, 0.52);
  color: #b64040;
}

@media (max-width: 1180px) {
  .vault-file-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .vault-file-card-list,
  .vault-preview-card {
    height: clamp(360px, 52vh, 560px);
  }

  .vault-preview-text {
    max-height: calc(48vh - 140px);
  }
}

@media (max-width: 900px) {
  .vault-file-item {
    flex-direction: column;
    align-items: stretch;
  }

  .vault-file-actions {
    justify-content: flex-start;
  }

  .vault-preview-open-card {
    min-height: 140px;
  }
}

.ai-assistant {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
}

.ai-display-canvas {
  box-sizing: border-box;
  width: min(1520px, 100%);
  height: clamp(646px, 77vh, 910px);
  padding: clamp(10px, 1.15vw, 16px);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(2px);
  overflow: hidden;
}

.ai-history-panel {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2));
  padding: 10px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

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

.ai-history-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-history-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.ai-history-head button {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.ai-history-head .ai-history-icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.ai-history-head .ai-history-icon-button svg {
  width: 15px;
  height: 15px;
}

.ai-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(49, 127, 185, 0.56) rgba(255, 255, 255, 0.12);
}

.ai-history-list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.ai-history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.ai-history-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(68, 146, 202, 0.72), rgba(39, 114, 172, 0.66));
  border-radius: 999px;
}

.ai-history-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(84, 161, 216, 0.82), rgba(49, 125, 184, 0.76));
}

.ai-history-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.ai-history-item {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.ai-history-item-check-wrap {
  min-width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-history-item-check {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #1779ea;
  cursor: pointer;
}

.ai-history-item-btn {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 72px;
  box-sizing: border-box;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  grid-template-rows: auto 1fr;
  align-content: center;
  justify-items: stretch;
  overflow: hidden;
}

.ai-history-item-btn strong {
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-item-btn small {
  color: var(--text-subtle);
  font-size: 0.72rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-item-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.ai-history-item.is-selected .ai-history-item-btn {
  border-color: rgba(20, 122, 235, 0.38);
  box-shadow: inset 0 0 0 1px rgba(20, 122, 235, 0.15);
  background: linear-gradient(146deg, rgba(20, 122, 235, 0.12), rgba(8, 157, 138, 0.08));
}

.ai-history-item.is-active .ai-history-item-btn {
  border-color: rgba(14, 110, 232, 0.42);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.16);
  background: linear-gradient(142deg, rgba(14, 110, 232, 0.14), rgba(10, 143, 131, 0.08));
}

.ai-history-item.is-search-hit .ai-history-item-btn {
  border-color: rgba(226, 85, 25, 0.46);
  box-shadow: inset 0 0 0 1px rgba(226, 85, 25, 0.14);
  background: linear-gradient(144deg, rgba(226, 85, 25, 0.12), rgba(255, 205, 118, 0.08));
}

.ai-history-item.is-search-focus .ai-history-item-btn {
  border-color: rgba(226, 85, 25, 0.62);
  box-shadow: inset 0 0 0 2px rgba(226, 85, 25, 0.2);
}

.ai-history-item.is-search-flash .ai-history-item-btn {
  animation: ai-history-search-flash 0.9s ease;
}

@keyframes ai-history-search-flash {
  0% {
    box-shadow: inset 0 0 0 2px rgba(226, 85, 25, 0.36), 0 0 0 0 rgba(226, 85, 25, 0.24);
  }
  100% {
    box-shadow: inset 0 0 0 2px rgba(226, 85, 25, 0.2), 0 0 0 12px rgba(226, 85, 25, 0);
  }
}

.ai-history-head button.is-active {
  border-color: rgba(14, 110, 232, 0.46);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.2);
  background: linear-gradient(140deg, rgba(14, 110, 232, 0.16), rgba(10, 143, 131, 0.1));
}

.ai-history-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.ai-main-pane {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.ai-quick-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-quick-model-field {
  display: inline-grid;
  gap: 5px;
}

.ai-quick-model-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-quick-model-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.ai-quick-model-field select {
  min-width: min(420px, 76vw);
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
}

.ai-quick-mode-select {
  min-width: 110px !important;
}

.ai-quick-model-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-subtle);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 10px;
  white-space: nowrap;
}

.ai-agent-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--chip-bg);
}

.ai-agent-mode-switch[hidden] {
  display: none !important;
}

.ai-agent-mode-switch button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-subtle);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 11px;
  cursor: pointer;
}

.ai-agent-mode-switch button.is-active {
  color: var(--text-main);
  background: linear-gradient(148deg, rgba(14, 110, 232, 0.2), rgba(10, 143, 131, 0.16));
}

.ai-agent-mode-switch button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.ai-quick-actions button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.ai-quick-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-dialog-stage {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.ai-dialog-content {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.ai-assistant.is-empty .ai-dialog-stage {
  align-content: stretch;
}

.ai-assistant.is-empty .ai-chat-panel,
.ai-assistant.is-empty .ai-composer,
.ai-assistant.is-empty .ai-runtime-status {
  width: 100%;
  justify-self: stretch;
}

.ai-assistant-head {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.2));
  padding: 8px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.ai-settings-head {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.ai-settings-provider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-settings-provider-row .ai-head-actions {
  margin-left: auto;
  align-items: center;
}

.ai-settings-head .ai-provider-switch,
.ai-settings-head .ai-head-actions {
  justify-self: start;
}

.ai-settings-head .ai-head-actions {
  justify-content: flex-start;
}

.ai-provider-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--chip-bg);
}

.ai-provider-switch button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-subtle);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.ai-provider-radio {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(91, 111, 132, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 0 rgba(14, 110, 232, 0.92);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.ai-provider-switch button.is-active {
  background: linear-gradient(145deg, rgba(14, 110, 232, 0.2), rgba(10, 143, 131, 0.16));
  color: var(--text-main);
}

.ai-provider-switch button.is-active .ai-provider-radio {
  border-color: rgba(14, 110, 232, 0.72);
  box-shadow: inset 0 0 0 3.8px rgba(14, 110, 232, 0.95);
}

.ai-connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--chip-bg);
  padding: 0 11px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.ai-connection-pill .indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.ai-connection-pill .indicator.is-idle {
  background: rgba(118, 126, 134, 0.8);
}

.ai-connection-pill .indicator.is-pending {
  background: rgba(228, 143, 12, 0.95);
  box-shadow: 0 0 0 3px rgba(228, 143, 12, 0.2);
}

.ai-connection-pill .indicator.is-ok {
  background: rgba(35, 173, 94, 0.95);
  box-shadow: 0 0 0 3px rgba(35, 173, 94, 0.18);
}

.ai-connection-pill .indicator.is-error {
  background: rgba(214, 63, 63, 0.94);
  box-shadow: 0 0 0 3px rgba(214, 63, 63, 0.2);
}

.ai-head-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.ai-head-actions button {
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 11px;
  cursor: pointer;
}

.ai-model-bar {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.15));
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.ai-field {
  display: grid;
  gap: 5px;
}

.ai-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.ai-field input,
.ai-field select {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.74);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
}

.ai-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-mode-switch button {
  min-height: 33px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-subtle);
  padding: 0 12px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-mode-switch button.is-active {
  color: var(--text-main);
  border-color: rgba(14, 110, 232, 0.45);
  background: linear-gradient(148deg, rgba(14, 110, 232, 0.2), rgba(10, 143, 131, 0.16));
}

.ai-system-prompt {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.16));
  padding: 8px;
  display: grid;
  gap: 7px;
}

.ai-system-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.ai-system-prompt textarea {
  width: 100%;
  min-height: 78px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.8);
  color: inherit;
  padding: 9px 10px;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.48;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 118, 176, 0.62) rgba(255, 255, 255, 0.18);
}

.ai-system-prompt textarea::-webkit-scrollbar {
  width: 12px;
}

.ai-system-prompt textarea::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.22);
  border-left: 1px solid rgba(12, 77, 132, 0.16);
}

.ai-system-prompt textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(180deg, rgba(70, 149, 210, 0.76), rgba(39, 111, 170, 0.7));
}

.ai-system-prompt textarea::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(83, 165, 226, 0.84), rgba(48, 124, 187, 0.78));
}

.ai-system-prompt textarea::-webkit-scrollbar-button {
  background: rgba(255, 255, 255, 0.2);
}

.ai-system-prompt textarea::-webkit-scrollbar-corner {
  background: rgba(255, 255, 255, 0.2);
}

.ai-chat-panel {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.16));
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-code-workspace {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.16));
  padding: 10px;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(300px, 46%);
  gap: 10px;
  overflow: hidden;
}

.ai-code-files-pane,
.ai-code-editor-pane,
.ai-code-preview-pane {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.ai-code-editor-pane {
  grid-template-rows: auto minmax(0, 1.1fr) minmax(120px, 0.9fr);
}

.ai-code-pane-head {
  min-height: 34px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.82);
}

.ai-code-pane-head strong {
  font-size: 0.78rem;
}

.ai-code-pane-head small {
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.ai-code-pane-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-code-pane-actions button {
  min-height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0 8px;
  cursor: pointer;
}

.ai-code-pane-actions button:hover {
  border-color: var(--accent);
}

.ai-code-file-list,
.ai-code-log-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
}

.ai-code-file-item {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  text-align: left;
  font-family: inherit;
  font-size: 0.74rem;
  line-height: 1.32;
  padding: 6px 8px;
  cursor: pointer;
}

.ai-code-file-item.is-active {
  border-color: rgba(14, 110, 232, 0.42);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.16);
  background: linear-gradient(142deg, rgba(14, 110, 232, 0.14), rgba(10, 143, 131, 0.08));
}

#aiCodeEditorInput {
  width: 100%;
  min-height: 0;
  resize: none;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  color: inherit;
  padding: 10px;
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  tab-size: 2;
}

.ai-code-logs {
  border-top: 1px solid var(--line-soft);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ai-code-log-list {
  background: rgba(14, 24, 40, 0.96);
  color: #dce8ff;
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.73rem;
}

.ai-code-log-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 7px;
  line-height: 1.35;
}

.ai-code-log-item.is-error {
  border-color: rgba(245, 92, 92, 0.56);
  color: #ffd4d4;
}

.ai-code-log-item.is-warn {
  border-color: rgba(245, 204, 92, 0.5);
  color: #ffeec9;
}

.ai-code-log-item.is-clickable {
  cursor: pointer;
}

.ai-code-auto-run {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.ai-code-auto-run input[type="checkbox"] {
  margin: 0;
}

#aiCodePreviewFrame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.ai-assistant.is-code-mode .ai-dialog-content {
  grid-template-columns: minmax(0, 1fr) minmax(620px, 1.25fr);
}

@media (max-width: 1540px) {
  .ai-assistant.is-code-mode .ai-dialog-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-code-workspace {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(240px, 38vh);
  }

  .ai-code-preview-pane {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .ai-code-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(120px, 0.45fr) minmax(240px, 0.95fr) minmax(220px, 1fr);
  }

  .ai-code-files-pane,
  .ai-code-editor-pane,
  .ai-code-preview-pane {
    height: auto;
  }
}

.ai-welcome-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  padding: 14px 16px;
}

.ai-welcome-card h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
}

.ai-welcome-card p {
  margin: 6px 0 0;
  color: var(--text-subtle);
  font-size: 0.82rem;
}

.ai-message {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  display: grid;
  gap: 7px;
  width: min(78%, 860px);
  align-self: flex-start;
  min-width: 0;
}

.ai-message.is-user {
  margin-left: auto;
  border-color: rgba(14, 110, 232, 0.35);
  background: linear-gradient(145deg, rgba(14, 110, 232, 0.1), rgba(255, 255, 255, 0.75));
}

.ai-message.is-assistant {
  margin-right: auto;
  border-color: rgba(10, 143, 131, 0.34);
  background: linear-gradient(145deg, rgba(10, 143, 131, 0.1), rgba(255, 255, 255, 0.75));
}

.ai-message.is-error {
  margin-right: auto;
  border-color: rgba(214, 63, 63, 0.4);
  background: linear-gradient(145deg, rgba(214, 63, 63, 0.12), rgba(255, 255, 255, 0.8));
}

.ai-message.is-search-focus {
  border-color: rgba(226, 85, 25, 0.58);
  box-shadow: inset 0 0 0 2px rgba(226, 85, 25, 0.18);
}

.ai-message.is-search-flash {
  animation: ai-search-flash 0.9s ease;
}

@keyframes ai-search-flash {
  0% {
    box-shadow: inset 0 0 0 2px rgba(226, 85, 25, 0.36), 0 0 0 0 rgba(226, 85, 25, 0.26);
  }
  100% {
    box-shadow: inset 0 0 0 2px rgba(226, 85, 25, 0.18), 0 0 0 14px rgba(226, 85, 25, 0);
  }
}

.ai-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
}

.ai-message-head strong {
  font-size: 0.76rem;
}

.ai-message-head small {
  color: var(--text-subtle);
}

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

.ai-message-copy,
.ai-message-download {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  min-height: 24px;
  padding: 0 8px;
  cursor: pointer;
}

.ai-message-copy:hover,
.ai-message-download:hover {
  border-color: var(--accent);
}

.ai-message.is-user .ai-message-head {
  justify-content: flex-end;
}

.ai-message.is-user .ai-message-head strong {
  order: 2;
}

.ai-message.is-user .ai-message-head small {
  order: 1;
}

.ai-message-body {
  font-size: 0.92rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.ai-message-body > * {
  max-width: 100%;
  min-width: 0;
}

.ai-message-body a {
  color: #0b70c7;
  text-decoration-color: rgba(11, 112, 199, 0.5);
  text-underline-offset: 2px;
  word-break: break-all;
}

.ai-message-body a:hover {
  color: #095ea8;
  text-decoration-color: rgba(9, 94, 168, 0.62);
}

.ai-message-body p {
  margin: 0 0 10px;
}

.ai-message-body p:last-child {
  margin-bottom: 0;
}

.ai-message-body mark.notice-highlight,
.ai-history-item-btn mark.notice-highlight {
  background: rgba(255, 207, 64, 0.52);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.ai-message-body pre {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-message-body code {
  font-family: "Consolas", "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-message-body table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  table-layout: fixed;
}

.ai-message-body th,
.ai-message-body td {
  border: 1px solid var(--line-soft);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-message-body .katex {
  font-size: 1.02em;
}

.ai-message-body .katex-display {
  margin: 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.ai-search-audit-card {
  margin: 8px 0 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(14, 110, 232, 0.06), rgba(10, 143, 131, 0.04));
  overflow: hidden;
}

.ai-search-audit-card summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 8px 10px;
  background: var(--chip-bg);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-search-audit-card summary::-webkit-details-marker {
  display: none;
}

.ai-search-audit-card summary::before {
  content: "\25B8";
  font-size: 0.72rem;
  color: var(--text-subtle);
  transition: transform 0.16s ease;
}

.ai-search-audit-card[open] summary::before {
  transform: rotate(90deg);
}

.ai-search-audit-meta {
  display: grid;
  gap: 4px;
  padding: 8px 10px 0;
}

.ai-search-audit-meta p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-subtle);
}

.ai-search-audit-list {
  margin: 8px 10px 10px;
  padding-left: 16px;
  display: grid;
  gap: 8px;
}

.ai-search-audit-list li {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 8px;
}

.ai-search-audit-list strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.ai-search-audit-list li > div {
  margin-bottom: 4px;
  font-size: 0.76rem;
}

.ai-search-audit-list p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.52;
}

.ai-message-inline-attachments {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-inline-attachment-image {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
}

.ai-inline-attachment-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.ai-inline-attachment-image:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ai-generated-image,
.ai-generated-video {
  max-width: min(100%, 460px);
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.ai-generated-image {
  cursor: zoom-in;
}

.ai-generated-image:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ai-generated-video {
  width: 100%;
}

body.ai-image-preview-open,
body.ai-code-preview-open,
body.network-image-preview-open {
  overflow: hidden;
}

.ai-image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 13, 25, 0.8);
  backdrop-filter: blur(2px);
}

.ai-image-preview-stage {
  position: relative;
  width: min(96vw, 1500px);
  height: min(92vh, 980px);
  padding: 26px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 14, 28, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
}

.ai-image-preview-image {
  max-width: 100%;
  max-height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

.ai-image-preview-image.is-zoomed {
  cursor: grab;
}

.ai-image-preview-image.is-grabbing {
  cursor: grabbing;
}

.ai-image-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.62);
  color: #f1f5ff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  height: 30px;
  min-width: 56px;
  padding: 0 12px;
  cursor: pointer;
}

.ai-image-preview-close:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(9, 17, 34, 0.76);
}

.ai-image-preview-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.75rem;
  color: rgba(236, 244, 255, 0.92);
  background: rgba(8, 16, 32, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.network-image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 13, 25, 0.8);
  backdrop-filter: blur(2px);
}

.network-image-preview-stage {
  position: relative;
  width: min(96vw, 1500px);
  height: min(92vh, 980px);
  padding: 26px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 14, 28, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
}

.network-image-preview-image {
  max-width: 100%;
  max-height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

.network-image-preview-image.is-zoomed {
  cursor: grab;
}

.network-image-preview-image.is-grabbing {
  cursor: grabbing;
}

.network-image-preview-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.network-image-preview-action {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(5, 10, 20, 0.62);
  color: #f1f5ff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  cursor: pointer;
}

.network-image-preview-action:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(9, 17, 34, 0.76);
}

.network-image-preview-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.22);
}

.network-image-preview-action:disabled:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(5, 10, 20, 0.62);
}

.network-image-preview-action.danger {
  border-color: rgba(255, 134, 134, 0.7);
  color: #ffdada;
}

.network-image-preview-action.danger:hover {
  border-color: rgba(255, 134, 134, 0.95);
  background: rgba(32, 10, 16, 0.8);
}

.network-image-preview-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.75rem;
  color: rgba(236, 244, 255, 0.92);
  background: rgba(8, 16, 32, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.ai-code-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 13, 25, 0.8);
  backdrop-filter: blur(2px);
}

.ai-code-preview-stage {
  position: relative;
  width: min(96vw, 1520px);
  height: min(92vh, 1000px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 14, 28, 0.82);
  overflow: hidden;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
}

.ai-code-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.ai-code-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.62);
  color: #f1f5ff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  height: 30px;
  min-width: 56px;
  padding: 0 12px;
  cursor: pointer;
  z-index: 2;
}

.ai-code-preview-close:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(9, 17, 34, 0.76);
}

.ai-code-preview-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.75rem;
  color: rgba(236, 244, 255, 0.92);
  background: rgba(8, 16, 32, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  z-index: 2;
}

.ai-composer {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.18));
  padding: 9px;
  display: grid;
  gap: 8px;
}

.ai-slash-panel {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(246, 251, 255, 0.96), rgba(239, 247, 255, 0.9));
  padding: 10px;
  display: grid;
  gap: 8px;
}

.ai-slash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#aiSlashBackButton {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--chip-bg);
  color: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}

.ai-slash-hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-subtle);
  line-height: 1.45;
}

.ai-slash-grid {
  display: grid;
  gap: 8px;
  max-height: min(38vh, 320px);
  overflow: auto;
  padding-right: 2px;
}

.ai-slash-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 9px 10px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 4px;
  transition: border-color 0.16s ease, transform 0.12s ease, background 0.16s ease;
}

.ai-slash-card strong {
  font-size: 0.82rem;
  line-height: 1.35;
}

.ai-slash-card small {
  font-size: 0.72rem;
  color: var(--text-subtle);
  line-height: 1.4;
}

.ai-slash-card:hover,
.ai-slash-card:focus-visible {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.98);
}

.ai-slash-card:active {
  transform: scale(0.99);
}

.ai-slash-empty {
  border: 1px dashed var(--line-soft);
  border-radius: 10px;
  padding: 12px;
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-subtle);
  text-align: center;
}

.ai-composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-attachment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.ai-web-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ai-web-search-engine-select {
  height: 34px;
  min-width: 132px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  padding: 0 30px 0 10px;
}

.ai-web-search-engine-select:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(14, 110, 232, 0.16);
}

.ai-web-search-engine-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-attachment-row input[type="file"] {
  display: none;
}

#aiAttachmentMeta {
  font-size: 0.74rem;
  color: var(--text-subtle);
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#aiAttachmentMeta[hidden] {
  display: none;
}

.ai-icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.12s ease;
}

.ai-icon-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-icon-button::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: auto;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 4px);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-bg-strong);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  padding: 6px 10px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 65;
}

.ai-icon-button:hover::after,
.ai-icon-button:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.ai-icon-button:hover {
  border-color: var(--line-strong);
}

.ai-icon-button:active {
  transform: scale(0.97);
}

.ai-icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-icon-button:disabled::after {
  opacity: 0;
  visibility: hidden;
}

.ai-icon-add {
  font-size: 1.24rem;
  font-weight: 600;
}

.ai-web-search-toggle.is-enabled {
  border-color: rgba(20, 150, 88, 0.48);
  background: linear-gradient(145deg, rgba(20, 160, 96, 0.22), rgba(14, 188, 112, 0.16));
  color: #0f6b41;
}

#aiMessageInput {
  width: 100%;
  min-height: 86px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  padding: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
}

.ai-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  flex: 0 0 auto;
}

#aiSendButton {
  border-color: rgba(14, 110, 232, 0.4);
  background: linear-gradient(145deg, rgba(14, 110, 232, 0.18), rgba(10, 143, 131, 0.14));
}

.ai-runtime-status {
  display: none !important;
}

.ai-runtime-status[hidden] {
  display: none !important;
}

.ai-runtime-status.is-error {
  color: #c73535;
}

.ai-api-backdrop {
  z-index: 76;
}

.ai-api-modal {
  width: min(496px, 92vw);
  max-height: min(88vh, 840px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--panel-bg-strong);
  box-shadow: var(--shadow-panel);
  padding: 14px;
  display: grid;
  gap: 10px;
  transform: translate3d(var(--ai-api-offset-x, 0px), var(--ai-api-offset-y, 0px), 0);
  will-change: transform;
}

.ai-api-modal.is-dragging {
  transition: none;
}

.ai-api-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.ai-api-modal.is-dragging .ai-api-modal-head {
  cursor: grabbing;
}

.ai-api-modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.ai-api-modal-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.ai-api-form {
  display: grid;
  gap: 8px;
  min-height: 0;
}

#aiNetworkApiGroup {
  display: grid;
  gap: 8px;
}

#aiNetworkApiGroup[hidden] {
  display: none;
}

#aiNetworkApiGroup > label {
  display: grid;
  gap: 5px;
}

#aiNetworkApiGroup > label > input {
  width: 100%;
}

.ai-network-profile-tools {
  display: grid;
  gap: 6px;
}

.ai-network-profile-tools > label {
  display: grid;
  gap: 5px;
}

#aiApiProfileSelect {
  width: 100%;
}

.ai-network-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-network-profile-actions button {
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.ai-api-form > label,
.ai-api-grid > label {
  display: grid;
  gap: 5px;
}

.ai-api-form span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
}

#aiApiProfileSelect,
.ai-api-form input {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
}

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

.ai-api-tip {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.ai-api-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ai-api-modal-actions button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.ai-api-status {
  margin: 0;
  min-height: 18px;
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.ai-api-status.is-error {
  color: #c73535;
}

.protected-data-layout {
  width: min(980px, 100%);
  display: grid;
  gap: 12px;
  text-align: left;
}

.website-collection-canvas {
  --website-collection-column-count: 8;
  --website-collection-row-height: 72px;
  --website-collection-row-gap: 8px;
  --website-collection-visible-rows: 6;
  width: min(1320px, 100%);
  max-width: min(1320px, 100%);
  min-height: clamp(520px, 66vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.website-collection-tags-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
}

.website-collection-tags-shell.is-scrollable {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 8px;
}

.website-collection-tags-viewport {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.56) rgba(255, 255, 255, 0.14);
}

.website-collection-tags-viewport:focus-visible {
  outline: none;
}

.website-collection-tags-viewport::-webkit-scrollbar {
  height: 8px;
}

.website-collection-tags-viewport::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.website-collection-tags-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(39, 130, 188, 0.72), rgba(31, 99, 168, 0.68));
}

.website-collection-tags-viewport::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(49, 151, 210, 0.84), rgba(35, 113, 188, 0.78));
}

.website-collection-tags-shell .website-collection-tags-nav {
  display: none;
}

.website-collection-tags-shell.is-scrollable .website-collection-tags-nav {
  display: inline-flex;
}

.website-collection-tags-nav {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.website-collection-tags-nav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.website-collection-tags-nav:hover:not(:disabled) {
  border-color: var(--accent-strong);
}

.website-collection-tags-nav:disabled {
  opacity: 0.38;
  cursor: default;
}

.website-collection-tags-shell.is-scrollable.can-scroll-left .website-collection-tags-viewport::before,
.website-collection-tags-shell.is-scrollable.can-scroll-right .website-collection-tags-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 24px;
  pointer-events: none;
  z-index: 2;
}

.website-collection-tags-shell.is-scrollable.can-scroll-left .website-collection-tags-viewport::before {
  left: 0;
  background: linear-gradient(90deg, var(--panel-bg), rgba(255, 255, 255, 0));
}

.website-collection-tags-shell.is-scrollable.can-scroll-right .website-collection-tags-viewport::after {
  right: 0;
  background: linear-gradient(270deg, var(--panel-bg), rgba(255, 255, 255, 0));
}

.website-collection-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-height: 42px;
  min-width: max-content;
  padding: 0 2px 6px;
}

.website-collection-tag {
  appearance: none;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--chip-bg);
  color: inherit;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 1.06rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.website-collection-tag:hover {
  border-color: var(--accent-strong);
}

.website-collection-tag:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.website-collection-tag.is-active {
  border-color: var(--accent-strong);
  background: rgba(10, 143, 131, 0.12);
  color: var(--text-main);
}

.website-collection-grid {
  display: grid;
  grid-template-columns: repeat(var(--website-collection-column-count), minmax(0, 1fr));
  grid-auto-rows: var(--website-collection-row-height);
  gap: var(--website-collection-row-gap);
  height: calc(
    var(--website-collection-row-height) * var(--website-collection-visible-rows) +
      var(--website-collection-row-gap) * (var(--website-collection-visible-rows) - 1)
  );
  min-height: 0;
  max-height: calc(
    var(--website-collection-row-height) * var(--website-collection-visible-rows) +
      var(--website-collection-row-gap) * (var(--website-collection-visible-rows) - 1)
  );
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 2px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.56) rgba(255, 255, 255, 0.14);
}

/* Only for "网络内容" view: desktop fixed 5 x 6 (30 cards), overflow uses vertical scrollbar. */
body[data-main-view="favorites"] .website-collection-canvas {
  --website-collection-column-count: 5;
  --website-collection-visible-rows: 6;
}

body[data-main-view="favorites"] .website-collection-grid {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body[data-main-view="favorites"] .website-collection-card {
  border-style: dashed;
}

@media (max-width: 1200px) {
  body[data-main-view="favorites"] .website-collection-canvas {
    --website-collection-column-count: 4;
  }
}

@media (max-width: 980px) {
  body[data-main-view="favorites"] .website-collection-canvas {
    --website-collection-column-count: 3;
  }
}

@media (max-width: 720px) {
  body[data-main-view="favorites"] .website-collection-canvas {
    --website-collection-column-count: 2;
  }
}

@media (max-width: 460px) {
  body[data-main-view="favorites"] .website-collection-canvas {
    --website-collection-column-count: 1;
  }
}

.website-collection-grid::-webkit-scrollbar {
  width: 8px;
}

.website-collection-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.website-collection-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(39, 130, 188, 0.72), rgba(31, 99, 168, 0.68));
}

.website-collection-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(49, 151, 210, 0.84), rgba(35, 113, 188, 0.78));
}

.website-collection-card {
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: stretch;
  align-content: stretch;
  gap: 4px;
  padding: 6px 8px;
  position: relative;
  border-color: var(--website-card-border-color, var(--line-soft));
  cursor: grab;
  user-select: none;
  transition: border-color 0.18s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.website-collection-card:hover {
  border-color: var(--website-card-border-color, var(--line-soft));
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(34, 106, 156, 0.12);
}

.website-collection-card.is-dragging {
  opacity: 0.48;
  cursor: grabbing;
}

.website-collection-card.drop-before {
  box-shadow: inset 0 3px 0 var(--accent-strong);
}

.website-collection-card.drop-after {
  box-shadow: inset 0 -3px 0 var(--accent-strong);
}

.website-collection-card.is-search-hit {
  outline: 1px solid rgba(226, 85, 25, 0.44);
  outline-offset: -1px;
}

.website-collection-card.is-search-focus {
  outline: 2px solid rgba(226, 85, 25, 0.64);
  outline-offset: -2px;
}

.website-collection-card.is-search-flash {
  animation: website-collection-search-flash 0.9s ease;
}

@keyframes website-collection-search-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(226, 85, 25, 0.3);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(226, 85, 25, 0);
  }
}

.website-collection-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  cursor: pointer;
  padding: 0;
}

.website-collection-link strong {
  font-size: 0.95rem;
  line-height: 1.2;
  width: 100%;
  text-align: center;
}

.website-collection-link:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
  border-radius: 8px;
}

.website-collection-card-type {
  margin: 1px 0 0;
  color: var(--text-subtle);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.website-collection-card-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: absolute;
  top: 50%;
  margin: 0;
  padding: 0;
  cursor: default;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  z-index: 2;
}

.website-collection-card-actions.is-right {
  right: 8px;
}

.website-collection-card-actions.is-left {
  left: 8px;
}

.website-collection-card:hover .website-collection-card-actions,
.website-collection-card.is-actions-visible .website-collection-card-actions,
.website-collection-card:focus-within .website-collection-card-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
  transition-delay: 0s;
}

.website-collection-card-action {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-subtle);
  line-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  box-shadow: none;
  opacity: 0.88;
  transition: color 0.16s ease, transform 0.12s ease, opacity 0.16s ease;
}

.website-collection-card-action:hover {
  background: transparent;
  color: var(--text-main);
  box-shadow: none;
  opacity: 1;
  transform: translateY(-1px);
}

.website-collection-card-action:active {
  transform: translateY(0);
}

.website-collection-card-action.danger {
  color: #b13d3d;
  background: transparent;
}

.website-collection-card-action.edit {
  color: #2f6ba8;
  background: transparent;
}

.website-collection-card-action.danger:hover {
  color: #922f2f;
}

.website-collection-card-action.edit:hover {
  color: #235180;
}

.website-collection-card-action svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.website-collection-card-action::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translate(-50%, -4px);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-bg-strong);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 7px 11px;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 30;
}

.website-collection-card-action:hover::after,
.website-collection-card-action:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.website-collection-empty {
  margin: 0;
  align-self: center;
  justify-self: center;
  color: var(--text-subtle);
  font-size: var(--step-0);
  text-align: center;
}

.protected-data-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.protected-data-tools button {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  min-height: 34px;
  padding: 0 10px;
  cursor: pointer;
}

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

.protected-data-form input,
.protected-data-form select,
.protected-data-form textarea {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
}

.protected-data-form textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}

.protected-data-form input:focus,
.protected-data-form select:focus,
.protected-data-form textarea:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.tasks-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tasks-workspace {
  width: min(1260px, 100%);
  display: grid;
  gap: 10px;
}

.tasks-workspace-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.tasks-workspace-head input {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
}

.tasks-workspace-head input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.tasks-workspace-head button {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

.tasks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-height: clamp(540px, 66vh, 760px);
}

.tasks-list-panel,
.tasks-editor-panel {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.34);
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

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

.tasks-calendar-host {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

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

.tasks-editor-form {
  align-content: start;
}

.tasks-data-tools {
  justify-content: flex-end;
}

.tasks-form-grid label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.tasks-form-grid label input,
.tasks-form-grid label select {
  width: 100%;
}

.tasks-calendar-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.tasks-calendar-head button {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
}

.tasks-calendar-head > strong {
  min-width: 0;
  text-align: center;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.tasks-calendar-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.tasks-calendar-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.tasks-calendar-view-switch button {
  min-height: 28px;
  min-width: 34px;
  border-radius: 8px;
  border: 0;
  padding: 0 9px;
  background: transparent;
}

.tasks-calendar-view-switch button.is-active {
  background: rgba(14, 110, 232, 0.18);
  color: var(--text-main);
}

.tasks-calendar-weekdays {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.tasks-calendar-weekdays li {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.tasks-calendar-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  min-height: 0;
}

.tasks-calendar-grid.is-week-view {
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  overflow-x: auto;
  padding-bottom: 2px;
}

.tasks-calendar-cell {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.38);
  min-height: 108px;
  padding: 5px;
  display: grid;
  gap: 4px;
  align-content: start;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.tasks-calendar-cell.is-outside {
  opacity: 0.58;
}

.tasks-calendar-cell.is-selected {
  border-color: rgba(14, 110, 232, 0.52);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.2);
  background: linear-gradient(155deg, rgba(227, 241, 255, 0.88), rgba(241, 248, 255, 0.68));
}

.tasks-calendar-cell.is-in-range {
  border-color: rgba(14, 110, 232, 0.36);
  background: linear-gradient(155deg, rgba(228, 242, 255, 0.84), rgba(240, 248, 255, 0.62));
}

.tasks-calendar-cell.is-range-start,
.tasks-calendar-cell.is-range-end {
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.26);
}

.tasks-calendar-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.28);
}

.tasks-calendar-cell.is-today-glow {
  border-color: rgba(10, 143, 131, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(10, 143, 131, 0.52),
    0 0 0 1px rgba(14, 176, 158, 0.42),
    0 0 22px rgba(14, 176, 158, 0.58);
  animation: tasks-today-cell-glow 1.2s ease-out 2;
}

@keyframes tasks-today-cell-glow {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(10, 143, 131, 0.22),
      0 0 0 0 rgba(14, 176, 158, 0),
      0 0 0 rgba(14, 176, 158, 0);
  }
  40% {
    box-shadow:
      inset 0 0 0 1px rgba(10, 143, 131, 0.56),
      0 0 0 1px rgba(14, 176, 158, 0.45),
      0 0 24px rgba(14, 176, 158, 0.62);
  }
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(10, 143, 131, 0.34),
      0 0 0 1px rgba(14, 176, 158, 0.28),
      0 0 12px rgba(14, 176, 158, 0.34);
  }
}

.tasks-calendar-cell.is-search-hit {
  border-color: rgba(228, 143, 12, 0.45);
  box-shadow: inset 0 0 0 1px rgba(228, 143, 12, 0.18);
}

.tasks-calendar-cell.is-search-focus {
  border-color: rgba(226, 85, 25, 0.58);
  box-shadow: inset 0 0 0 2px rgba(226, 85, 25, 0.24);
}

.tasks-calendar-day-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  padding: 0;
  display: grid;
  gap: 2px;
  align-content: start;
  cursor: pointer;
  min-height: 46px;
}

.tasks-calendar-day-number {
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tasks-calendar-count {
  display: none;
  justify-self: start;
  min-width: 20px;
  min-height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(14, 110, 232, 0.28);
  background: rgba(14, 110, 232, 0.14);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tasks-calendar-title {
  display: block;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text-subtle);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  cursor: text;
}

.tasks-calendar-title mark {
  background: rgba(255, 202, 58, 0.5);
  color: inherit;
  border-radius: 4px;
  padding: 0 1px;
}

.tasks-calendar-title.is-search-focus mark {
  background: rgba(251, 124, 44, 0.46);
}

.tasks-calendar-inline-form {
  display: none;
  margin: 0;
}

.tasks-calendar-cell.is-inline-editing .tasks-calendar-inline-form {
  display: block;
}

.tasks-calendar-cell.is-inline-editing .tasks-calendar-day-button {
  min-height: 0;
}

.tasks-calendar-cell.is-inline-editing .tasks-calendar-title,
.tasks-calendar-cell.is-inline-editing .tasks-calendar-count {
  display: none;
}

.tasks-calendar-inline-input {
  width: 100%;
  min-height: 30px;
  max-height: 160px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  padding: 0 2px;
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tasks-calendar-inline-input::placeholder {
  color: transparent;
}

.tasks-calendar-inline-input:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

.tasks-calendar-inline-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tasks-calendar-quick-form {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  padding: 8px 9px;
}

.tasks-calendar-quick-label {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.tasks-calendar-quick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.tasks-calendar-quick-row input {
  width: 100%;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.8);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  padding: 0 9px;
}

.tasks-calendar-quick-row input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.tasks-calendar-quick-row button {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
}

.tasks-calendar-quick-row button:disabled,
.tasks-calendar-quick-row input:disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

.tasks-overview {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  padding: 8px 10px;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.tasks-selected-date {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
}

.protected-data-form button,
.protected-data-item-actions button {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  min-height: 34px;
  padding: 0 10px;
  cursor: pointer;
}

.network-image-form button {
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
  box-sizing: border-box;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.protected-data-item-actions button.danger {
  border-color: rgba(200, 95, 95, 0.48);
  color: #b73939;
}

.protected-data-tools button:last-of-type {
  border-color: rgba(200, 95, 95, 0.48);
  color: #b73939;
}

.protected-data-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: min(48vh, 480px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.56) rgba(255, 255, 255, 0.14);
}

.tasks-list {
  max-height: none;
  min-height: 0;
  border-top: 1px dashed var(--line-soft);
  padding-top: 8px;
}

.tasks-list .protected-data-item.is-active {
  border-color: rgba(14, 110, 232, 0.56);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.22);
}

.protected-data-placeholder {
  color: var(--text-subtle);
  font-size: var(--step--1);
  border: 1px dashed var(--line-soft);
  border-radius: 10px;
  padding: 10px;
}

.protected-data-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.36);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.protected-data-item.is-done .protected-data-item-meta strong {
  text-decoration: line-through;
  color: var(--text-subtle);
}

.protected-data-item.is-overdue {
  border-color: rgba(206, 89, 89, 0.52);
  background: linear-gradient(160deg, rgba(255, 233, 233, 0.78), rgba(255, 245, 245, 0.62));
}

.protected-data-item.is-today {
  border-color: rgba(232, 158, 33, 0.46);
  background: linear-gradient(160deg, rgba(255, 247, 226, 0.74), rgba(255, 252, 240, 0.62));
}

.protected-data-item.is-soon {
  border-color: rgba(62, 145, 224, 0.36);
}

.protected-data-item-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.protected-data-item-meta strong {
  font-size: var(--step--1);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.protected-data-item-meta small,
.protected-data-item-meta span {
  color: var(--text-subtle);
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.protected-data-item-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.protected-data-status {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  padding: 8px 10px;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.protected-data-status.is-error {
  color: #cf3c4f;
}

.notes-auth-card {
  display: grid;
  gap: 10px;
  --notes-auth-field-width: min(100%, 300px);
}

.notes-auth-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
}

.notes-auth-head p {
  margin: 4px 0 0;
  color: var(--text-subtle);
  font-size: var(--step--1);
  line-height: 1.35;
}

.notes-auth-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  width: var(--notes-auth-field-width);
  margin-inline: auto;
}

.notes-auth-tabs button,
.notes-auth-placeholder button,
.notes-auth-form button,
.notes-auth-session-actions button,
.notes-workspace-head button,
.notes-workspace-head select,
.notes-toolbar-primary button,
.notes-toolbar-more-toggle,
.notes-toolbar-more-menu button,
.notes-editor-actions button {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  min-height: 34px;
  padding: 0 10px;
  cursor: pointer;
}

.notes-auth-placeholder > button {
  width: clamp(92px, 10vw, 118px);
  height: clamp(92px, 10vw, 118px);
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border-color: rgba(8, 114, 188, 0.44);
  background: linear-gradient(160deg, rgba(10, 143, 131, 0.9), rgba(14, 110, 232, 0.84));
  color: #f7fdff;
  font-size: clamp(1rem, 0.92rem + 0.4vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 26px rgba(7, 67, 129, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.notes-auth-placeholder > button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(7, 67, 129, 0.28);
  filter: saturate(1.04);
}

.notes-auth-placeholder > button:active {
  transform: translateY(0);
}

.notes-auth-tabs button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.24);
}

.notes-auth-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: var(--notes-auth-field-width);
  margin-inline: auto;
}

.notes-settings-panel {
  display: grid;
  gap: 8px;
}

.notes-auth-form input {
  width: 100%;
  box-sizing: border-box;
}

.notes-password-field {
  position: relative;
  width: 100%;
}

.notes-password-field > input {
  padding-right: 40px;
}

/* Hide the native reveal icon to avoid dark/light inconsistencies; we use an explicit toggle button. */
.notes-auth-form input[type="password"]::-ms-reveal,
.notes-auth-form input[type="password"]::-ms-clear {
  display: none;
}

.notes-auth-form .notes-password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 2;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(19, 45, 73, 0.78);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.notes-auth-form .notes-password-visibility-toggle:hover,
.notes-auth-form .notes-password-visibility-toggle:focus-visible {
  outline: none;
  color: #0d73dd;
  background: rgba(13, 115, 221, 0.14);
}

.notes-auth-form .notes-password-visibility-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-auth-form .notes-password-visibility-toggle .notes-password-visibility-slash {
  opacity: 1;
  transition: opacity 0.14s ease;
}

.notes-auth-form .notes-password-visibility-toggle.is-visible .notes-password-visibility-slash {
  opacity: 0;
}

.notes-auth-form button {
  width: 100%;
  box-sizing: border-box;
}

.notes-auth-form input,
.notes-workspace-head input,
.notes-editor-meta input,
.notes-editor-panel textarea {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
}

.notes-auth-form input:focus,
.notes-workspace-head input:focus,
.notes-editor-meta input:focus,
.notes-editor-panel textarea:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.notes-auth-form input {
  font-family: "Sora", "Noto Sans SC", sans-serif !important;
  font-style: normal;
  font-weight: 600 !important;
  font-synthesis: none;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.notes-auth-form input::placeholder {
  font-family: "Sora", "Noto Sans SC", sans-serif !important;
  font-style: normal;
  font-weight: 500 !important;
  font-synthesis: none;
  letter-spacing: 0;
}

.notes-auth-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notes-auth-session strong {
  font-size: var(--step--1);
}

.notes-auth-session-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notes-auth-status {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.notes-login-hint {
  margin: -4px 0 2px;
  color: var(--text-subtle);
  font-size: var(--step--2);
}

.notes-center > .notes-auth-status {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  padding: 8px 10px;
}

.notes-auth-modal > .notes-auth-modal-status {
  width: var(--notes-auth-field-width);
  margin-inline: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  padding: 8px 10px;
}

.notes-auth-status.is-error {
  color: #cf3c4f;
}

.notes-auth-backdrop {
  z-index: 74;
  padding: clamp(10px, 2.4vh, 20px);
}

.notes-auth-modal {
  width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - clamp(20px, 5vh, 48px));
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.52) rgba(255, 255, 255, 0.14);
}

.notes-auth-modal::-webkit-scrollbar {
  width: 9px;
}

.notes-auth-modal::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.notes-auth-modal::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(30, 125, 188, 0.72), rgba(16, 95, 171, 0.62));
  border-radius: 999px;
}

.notes-auth-modal::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(30, 125, 188, 0.86), rgba(16, 95, 171, 0.76));
}

.notes-auth-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notes-auth-close-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.notes-workspace {
  min-height: clamp(620px, 74vh, 860px);
  max-height: clamp(620px, 74vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.notes-workspace-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(5, auto);
  align-items: center;
  gap: 8px;
}

.notes-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(220px, 19vw, 286px) minmax(0, 1fr);
  gap: 10px;
}

.notes-list-panel,
.notes-editor-panel {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  min-height: 0;
}

.notes-list-panel {
  padding: 8px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.56) rgba(255, 255, 255, 0.14);
}

.notes-list-panel::-webkit-scrollbar {
  width: 8px;
}

.notes-list-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.notes-list-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(39, 130, 188, 0.72), rgba(31, 99, 168, 0.68));
  border-radius: 999px;
}

.notes-list-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(49, 151, 210, 0.84), rgba(35, 113, 188, 0.78));
}

.notes-tree-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 10px;
}

.notes-tree-meta strong {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.notes-tree-meta small {
  color: var(--text-subtle);
  font-size: 0.68rem;
}

.notes-search-panel {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.52);
  padding: 6px;
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
}

.notes-search-meta {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.notes-search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  max-height: 210px;
  overflow: auto;
}

.notes-search-result-btn {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  color: inherit;
  text-align: left;
  padding: 6px 7px;
  display: grid;
  gap: 3px;
  cursor: pointer;
}

.notes-search-result-btn strong {
  font-size: 0.74rem;
  line-height: 1.25;
}

.notes-search-result-btn small,
.notes-search-result-btn span {
  color: var(--text-subtle);
  font-size: 0.64rem;
  line-height: 1.3;
}

.notes-search-result-btn.is-active {
  border-color: rgba(14, 110, 232, 0.55);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.2);
}

.notes-search-result-btn.is-current {
  border-color: rgba(10, 143, 131, 0.58);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.2);
}

.notes-search-result-btn.is-current.is-active {
  border-color: rgba(14, 110, 232, 0.6);
  box-shadow:
    inset 0 0 0 1px rgba(14, 110, 232, 0.24),
    0 0 0 1px rgba(10, 143, 131, 0.22);
}

.notes-search-empty {
  color: var(--text-subtle);
  font-size: 0.68rem;
  padding: 4px 2px;
}

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

.notes-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 188px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 16px 32px rgba(12, 42, 78, 0.14),
    0 2px 8px rgba(12, 42, 78, 0.08);
  padding: 5px;
  display: grid;
  gap: 4px;
}

.notes-context-menu button {
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 0 8px;
  cursor: pointer;
}

.notes-context-menu button:not(:disabled):hover {
  border-color: rgba(14, 110, 232, 0.32);
  background: rgba(14, 110, 232, 0.08);
}

.notes-context-menu button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.notes-list.is-drop-root {
  box-shadow: inset 0 0 0 2px rgba(14, 110, 232, 0.36);
  border-radius: 10px;
  padding: 4px;
}

.notes-tree-item {
  list-style: none;
}

.notes-tree-item.is-dragging {
  opacity: 0.46;
}

.notes-tree-item.is-drop-before .notes-item-btn {
  box-shadow: inset 0 2px 0 rgba(14, 110, 232, 0.7);
}

.notes-tree-item.is-drop-after .notes-item-btn {
  box-shadow: inset 0 -2px 0 rgba(14, 110, 232, 0.7);
}

.notes-tree-item.is-drop-inside .notes-item-btn {
  border-color: rgba(14, 110, 232, 0.72);
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.26);
}

.notes-placeholder {
  color: var(--text-subtle);
  font-size: var(--step--1);
  padding: 8px 6px;
}

.notes-item-btn {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.36);
  color: inherit;
  padding: 8px 9px 8px calc(10px + var(--notes-indent, 0px));
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
}

.notes-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.notes-item-btn strong {
  font-size: var(--step--1);
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-placement-count {
  margin: 0;
  font-style: normal;
  font-size: 0.65rem;
  line-height: 1.3;
  border-radius: 999px;
  border: 1px solid rgba(10, 143, 131, 0.32);
  background: rgba(10, 143, 131, 0.14);
  color: #06695f;
  padding: 0 6px;
}

.notes-item-btn small {
  color: var(--text-subtle);
  font-size: 0.66rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-item-btn span {
  color: var(--text-subtle);
  font-size: 0.66rem;
  line-height: 1.25;
}

.notes-item-btn.is-active {
  border-color: var(--note-accent, var(--accent));
  box-shadow: inset 3px 0 0 var(--note-accent, var(--accent));
}

.notes-editor-panel {
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 8px;
}

.notes-editor-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.notes-color-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.notes-color-field input[type="color"] {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}

.notes-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-editor-toolbar {
  display: grid;
  gap: 8px;
}

.notes-toolbar-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.notes-toolbar-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.notes-toolbar-primary button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.notes-toolbar-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(11, 88, 128, 0.18);
}

.notes-toolbar-overflow {
  position: relative;
  flex: 0 0 auto;
}

.notes-toolbar-more-toggle {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.notes-toolbar-more-toggle.is-active {
  border-color: rgba(10, 143, 131, 0.46);
  background: rgba(10, 143, 131, 0.12);
}

.notes-toolbar-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 178px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 14px 30px rgba(12, 42, 78, 0.14),
    0 2px 8px rgba(12, 42, 78, 0.08);
  display: grid;
  gap: 4px;
  padding: 6px;
}

.notes-toolbar-more-menu button {
  min-height: 30px;
  width: 100%;
  text-align: left;
  font-size: 0.7rem;
  justify-content: flex-start;
}

.notes-toolbar-modes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-source-mode {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  width: fit-content;
}

.notes-source-mode button {
  border: 0;
  background: transparent;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.notes-source-mode button.is-active {
  background: rgba(10, 143, 131, 0.18);
}

.notes-rich-tools-config-toggle {
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
}

.notes-rich-tools-config-toggle.is-active {
  border-color: rgba(10, 143, 131, 0.46);
  background: rgba(10, 143, 131, 0.12);
}

.notes-rich-tools-config {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.notes-rich-tools-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notes-rich-tools-config-head strong {
  font-size: 0.72rem;
}

.notes-rich-tools-config-head button {
  min-height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0 8px;
  cursor: pointer;
}

.notes-rich-tools-config-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px 8px;
}

.notes-rich-tools-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.notes-rich-tools-option input {
  margin: 0;
}

.notes-rich-tools {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding-bottom: 1px;
}

.notes-rich-tools button {
  flex: 0 0 auto;
  min-height: 30px;
  min-width: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
  color: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 8px;
  cursor: pointer;
  white-space: nowrap;
}

.notes-rich-tools button em {
  font-style: italic;
}

.notes-editor-mode {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.54);
  width: fit-content;
}

.notes-editor-mode button {
  border: 0;
  background: transparent;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.notes-editor-mode button.is-active {
  background: rgba(14, 110, 232, 0.16);
}

.notes-editor-stage {
  min-height: 0;
  display: grid;
  gap: 8px;
  height: 100%;
}

.notes-editor-stage[data-mode="write"] {
  grid-template-columns: minmax(0, 1fr);
}

.notes-editor-stage[data-mode="write"] .notes-preview-pane {
  display: none;
}

.notes-editor-stage[data-mode="split"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notes-editor-stage[data-mode="preview"] {
  grid-template-columns: minmax(0, 1fr);
}

.notes-editor-stage[data-mode="preview"] textarea,
.notes-editor-stage[data-mode="preview"] .notes-rich-editor {
  display: none;
}

.notes-editor-stage[data-source-mode="rich"] textarea {
  display: none;
}

.notes-editor-stage[data-source-mode="markdown"] .notes-rich-editor {
  display: none;
}

.notes-editor-stage textarea,
.notes-rich-editor,
.notes-preview-pane {
  min-height: 0;
  height: 100%;
}

.notes-editor-stage textarea {
  resize: none;
  padding: 10px;
  line-height: 1.6;
  font-family: "JetBrains Mono", "Noto Sans SC", monospace;
  font-size: 0.88rem;
}

.notes-rich-editor {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px;
  overflow: auto;
  line-height: 1.66;
  font-size: 0.88rem;
  word-break: break-word;
}

.notes-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-subtle);
}

.notes-rich-editor:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.notes-rich-editor img {
  max-width: 100%;
  border-radius: 8px;
}

.notes-rich-editor pre {
  background: rgba(245, 249, 253, 0.9);
  border: 1px solid rgba(50, 112, 162, 0.16);
  border-radius: 8px;
  padding: 8px 10px;
  overflow: auto;
}

.notes-rich-editor table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.7em 0;
}

.notes-rich-editor th,
.notes-rich-editor td {
  border: 1px solid var(--line-soft);
  padding: 6px 8px;
  text-align: left;
}

.notes-preview-pane {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  padding: 12px;
  overflow: auto;
  line-height: 1.7;
  font-size: 0.86rem;
  scrollbar-width: thin;
}

.notes-preview-pane pre {
  margin: 0.7em 0;
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
}

.notes-preview-pane .hljs {
  background: rgba(240, 246, 252, 0.95);
  border-radius: 8px;
  border: 1px solid rgba(32, 92, 142, 0.16);
}

.notes-preview-pane code:not(pre code) {
  background: rgba(17, 111, 197, 0.1);
  border-radius: 5px;
  padding: 0 5px;
}

.notes-preview-pane table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
}

.notes-preview-pane th,
.notes-preview-pane td {
  border: 1px solid var(--line-soft);
  padding: 6px 8px;
  text-align: left;
}

.notes-preview-pane img {
  max-width: 100%;
  border-radius: 8px;
}

.notes-preview-placeholder {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.78rem;
}

.notes-editor-actions button {
  min-height: 32px;
}

.local-center {
  width: 100%;
  min-height: clamp(560px, 72vh, 860px);
  display: grid;
  align-content: start;
  gap: 12px;
}

.local-grid {
  --local-card-height: 86px;
  --local-card-gap: 8px;
  --local-visible-rows: 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.local-block {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.14));
  padding: 12px;
  min-height: clamp(660px, 74vh, 860px);
  max-height: clamp(660px, 74vh, 860px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

.local-block-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
}

.local-add-form {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) minmax(220px, 2fr) auto;
  gap: 8px;
}

.local-add-form input {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
}

.local-add-form input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.local-add-form button,
.local-item-actions button {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  cursor: pointer;
}

.local-add-form button {
  min-height: 36px;
  padding: 0 12px;
}

.local-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: var(--local-card-height);
  gap: var(--local-card-gap);
  max-height: calc(
    var(--local-card-height) * var(--local-visible-rows) +
      var(--local-card-gap) * (var(--local-visible-rows) - 1)
  );
  min-height: 0;
  align-content: start;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.56) rgba(255, 255, 255, 0.14);
}

.local-list::-webkit-scrollbar {
  width: 8px;
}

.local-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.local-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(39, 130, 188, 0.72), rgba(31, 99, 168, 0.68));
  border-radius: 999px;
}

.local-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(49, 151, 210, 0.84), rgba(35, 113, 188, 0.78));
}

.local-placeholder {
  grid-column: 1 / -1;
  color: var(--text-subtle);
  font-size: var(--step--1);
  padding: 8px 4px;
}

.local-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  min-height: 0;
  height: 100%;
  padding: 8px 9px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
}

.local-item-meta {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 2px;
}

.local-item-meta strong {
  font-size: var(--step--1);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-item-meta small {
  font-size: 0.68rem;
  color: var(--text-subtle);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.local-item-actions button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.local-item-actions button.danger {
  border-color: rgba(190, 74, 74, 0.5);
}

.local-status {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.local-status.is-error {
  color: #cf3c4f;
}

.notice-backdrop {
  z-index: 72;
  padding: clamp(8px, 1.8vh, 14px);
}

.notice-modal {
  width: min(1040px, 100%);
  height: min(760px, calc(100vh - clamp(16px, 3.6vh, 28px)));
  max-height: calc(100vh - clamp(16px, 3.6vh, 28px));
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--panel-bg-strong);
  box-shadow: var(--shadow-panel);
  padding: clamp(14px, 1.8vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transform: translate3d(var(--notice-offset-x, 0px), var(--notice-offset-y, 0px), 0);
  will-change: transform;
}

.notice-modal.is-dragging {
  transition: none;
}

.tutorial-center.notice-modal {
  width: 100%;
  height: min(760px, calc(100vh - clamp(190px, 23vh, 250px)));
  max-height: calc(100vh - clamp(150px, 18vh, 220px));
  transform: none;
  will-change: auto;
}

.tutorial-center .notice-head {
  cursor: default;
}

.tutorial-center .notice-doc {
  font-family: var(--font-doc-readable);
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.tutorial-center .notice-doc h1,
.tutorial-center .notice-doc h2,
.tutorial-center .notice-doc h3,
.tutorial-center .notice-doc h4,
.tutorial-center .notice-doc h5,
.tutorial-center .notice-doc h6 {
  font-family: var(--font-doc-readable);
  font-weight: 700;
}

.tutorial-center .notice-item-btn strong,
.tutorial-center .notice-item-btn small {
  font-family: var(--font-doc-readable);
}

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

.notice-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
}

.notice-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}

.notice-head-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notice-head-filters input,
.notice-head-filters select,
.notice-head-filters .notice-sort-toggle {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0 9px;
}

.notice-head-filters input {
  width: min(300px, 42vw);
}

.notice-head-filters select {
  min-width: 72px;
}

.notice-head-filters .notice-sort-toggle {
  min-width: 48px;
  font-weight: 650;
  cursor: pointer;
}

.notice-head-filters input:focus,
.notice-head-filters select:focus,
.notice-head-filters .notice-sort-toggle:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.notice-refresh-btn,
.notice-copy-btn,
.notice-close-btn {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.notice-refresh-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: var(--step--1);
  font-weight: 650;
}

.notice-copy-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: var(--step--1);
  font-weight: 650;
}

.notice-copy-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.notice-copy-btn.is-error {
  border-color: rgba(189, 66, 66, 0.56);
}

.notice-close-btn {
  width: 34px;
  height: 34px;
  font-size: 1.24rem;
  line-height: 1;
}

.notice-source-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.notice-source-hint code {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 1px 5px;
}

.notice-layout {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.notice-list-panel,
.notice-content-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--panel-bg);
  min-height: 0;
}

.notice-list-panel {
  overflow: auto;
  padding: 8px;
}

.notice-content-panel {
  overflow: hidden;
}

.notice-list-panel,
.notice-doc,
.notice-doc pre {
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.52) rgba(255, 255, 255, 0.14);
}

.notice-list-panel::-webkit-scrollbar,
.notice-doc::-webkit-scrollbar,
.notice-doc pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.notice-list-panel::-webkit-scrollbar-track,
.notice-doc::-webkit-scrollbar-track,
.notice-doc pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.notice-list-panel::-webkit-scrollbar-thumb,
.notice-doc::-webkit-scrollbar-thumb,
.notice-doc pre::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(30, 125, 188, 0.72), rgba(16, 95, 171, 0.62));
  border-radius: 999px;
}

.notice-list-panel::-webkit-scrollbar-thumb:hover,
.notice-doc::-webkit-scrollbar-thumb:hover,
.notice-doc pre::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(30, 125, 188, 0.86), rgba(16, 95, 171, 0.76));
}

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

.notice-item-btn {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  min-height: 38px;
  padding: 7px 9px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.notice-item-btn strong {
  font-size: var(--step--1);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.notice-item-btn small {
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.notice-item-btn.is-active {
  border-color: rgba(14, 110, 232, 0.54);
  background: linear-gradient(140deg, rgba(14, 110, 232, 0.16), rgba(10, 143, 131, 0.1));
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.2);
}

.notice-doc {
  height: 100%;
  overflow: auto;
  padding: 14px 16px 18px;
  font-size: var(--step-0);
  line-height: 1.65;
}

.notice-placeholder {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.notice-list .notice-placeholder {
  padding: 8px 6px;
}

.notice-doc h1,
.notice-doc h2,
.notice-doc h3,
.notice-doc h4,
.notice-doc h5,
.notice-doc h6 {
  margin: 1.05em 0 0.5em;
  line-height: 1.3;
  font-family: var(--font-display);
}

.notice-doc h1 {
  font-size: var(--step-2);
}

.notice-doc h2 {
  font-size: var(--step-1);
}

.notice-doc h3 {
  font-size: var(--step-0);
}

.notice-doc p,
.notice-doc ul,
.notice-doc ol,
.notice-doc table,
.notice-doc blockquote,
.notice-doc pre {
  margin: 0.52em 0;
}

.notice-doc ul,
.notice-doc ol {
  padding-inline-start: 1.4em;
}

.notice-doc code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84em;
  background: rgba(128, 150, 173, 0.22);
  padding: 1px 5px;
  border-radius: 6px;
}

.notice-doc pre {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(128, 150, 173, 0.16);
  padding: 10px 12px;
  overflow: auto;
}

.notice-doc pre code {
  background: transparent;
  padding: 0;
}

.notice-doc table {
  width: 100%;
  border-collapse: collapse;
}

.notice-doc th,
.notice-doc td {
  border: 1px solid var(--line-soft);
  padding: 6px 8px;
  text-align: left;
}

.notice-doc blockquote {
  margin-left: 0;
  padding: 8px 10px;
  border-left: 3px solid rgba(14, 110, 232, 0.52);
  background: rgba(128, 150, 173, 0.16);
  border-radius: 8px;
}

.notice-doc a {
  color: var(--accent-strong);
}

.notice-highlight {
  background: rgba(255, 207, 64, 0.5);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

body.notice-dragging {
  user-select: none;
}

body.ai-api-dragging {
  user-select: none;
}

body[data-theme="dark"] .notice-source-hint code {
  background: rgba(7, 27, 46, 0.84);
}

body[data-theme="dark"] .notice-item-btn.is-active {
  border-color: rgba(89, 197, 255, 0.82);
  background: linear-gradient(140deg, rgba(89, 197, 255, 0.24), rgba(37, 240, 204, 0.14));
  box-shadow: inset 0 0 0 1px rgba(89, 197, 255, 0.24);
}

body[data-theme="dark"] .notice-head-filters input,
body[data-theme="dark"] .notice-head-filters select,
body[data-theme="dark"] .notice-head-filters .notice-sort-toggle {
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
  border-color: rgba(140, 194, 243, 0.38);
  color-scheme: dark;
}

body[data-theme="dark"] .notice-head-filters input:focus,
body[data-theme="dark"] .notice-head-filters select:focus,
body[data-theme="dark"] .notice-head-filters .notice-sort-toggle:focus-visible {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .notice-highlight {
  background: rgba(255, 203, 79, 0.34);
}

body[data-theme="dark"] .notice-doc code {
  background: rgba(18, 53, 85, 0.72);
}

body[data-theme="dark"] .notice-doc pre {
  background: rgba(8, 33, 58, 0.84);
  border-color: rgba(140, 194, 243, 0.34);
}

body[data-theme="dark"] .notice-doc blockquote {
  background: rgba(15, 42, 68, 0.8);
  border-left-color: rgba(89, 197, 255, 0.72);
}

body[data-theme="dark"] .notice-list-panel,
body[data-theme="dark"] .notice-doc,
body[data-theme="dark"] .notice-doc pre {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .notice-list-panel::-webkit-scrollbar-track,
body[data-theme="dark"] .notice-doc::-webkit-scrollbar-track,
body[data-theme="dark"] .notice-doc pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .notice-list-panel::-webkit-scrollbar-thumb,
body[data-theme="dark"] .notice-doc::-webkit-scrollbar-thumb,
body[data-theme="dark"] .notice-doc pre::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .notice-list-panel::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .notice-doc::-webkit-scrollbar-thumb:hover,
body[data-theme="dark"] .notice-doc pre::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .topbar {
  background:
    linear-gradient(130deg, rgba(6, 19, 33, 0.88), rgba(8, 24, 40, 0.76)),
    var(--panel-bg);
}

body[data-theme="dark"] .headline p {
  color: #bcd0e6;
}

body[data-theme="dark"] .recommend-category,
body[data-theme="dark"] .recommend-item {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
}

body[data-theme="dark"] .recommend-category-title,
body[data-theme="dark"] .recommend-item strong,
body[data-theme="dark"] .recommend-link {
  color: #edf5ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .recommend-item span {
  color: #cadcf0;
}

body[data-theme="dark"] .recommend-link:hover {
  color: #8edcff;
}

body[data-theme="dark"] .view-search-toolbar {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
}

body[data-theme="dark"] .view-search-input-wrap input,
body[data-theme="dark"] .view-search-input-wrap select {
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
  border-color: rgba(140, 194, 243, 0.38);
}

body[data-theme="dark"] .view-search-input-wrap input:focus,
body[data-theme="dark"] .view-search-input-wrap select:focus {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .view-search-input-wrap button {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .view-search-meta {
  color: #cadcf0;
}

body[data-theme="dark"] .recommend-items-grid {
  scrollbar-color: rgba(150, 196, 233, 0.72) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .recommend-items-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .recommend-items-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(154, 198, 231, 0.78), rgba(106, 163, 212, 0.72));
}

body[data-theme="dark"] .recommend-items-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(175, 214, 244, 0.88), rgba(122, 183, 229, 0.8));
}

body[data-theme="dark"] .site-footer p {
  color: #b4c8dd;
}

body[data-theme="dark"] .local-placeholder,
body[data-theme="dark"] .local-item-meta small,
body[data-theme="dark"] .local-status {
  color: #bcd0e6;
}

body[data-theme="dark"] .local-block,
body[data-theme="dark"] .local-item {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
}

body[data-theme="dark"] .local-block-head h4,
body[data-theme="dark"] .local-item-meta strong {
  color: #edf5ff;
}

body[data-theme="dark"] .local-add-form input {
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
  border-color: rgba(140, 194, 243, 0.38);
}

body[data-theme="dark"] .local-add-form input:focus {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .local-add-form button,
body[data-theme="dark"] .local-item-actions button {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .local-item-actions button.danger {
  border-color: rgba(218, 109, 109, 0.62);
}

body[data-theme="dark"] .local-list {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .local-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .local-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .local-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .notes-auth-card,
body[data-theme="dark"] .notes-auth-placeholder,
body[data-theme="dark"] .protected-feature-workspace,
body[data-theme="dark"] .notes-workspace,
body[data-theme="dark"] .notes-list-panel,
body[data-theme="dark"] .notes-editor-panel,
body[data-theme="dark"] .notes-search-panel,
body[data-theme="dark"] .notes-search-result-btn,
body[data-theme="dark"] .notes-rich-editor,
body[data-theme="dark"] .notes-item-btn {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
}

body[data-theme="dark"] .notes-auth-head p,
body[data-theme="dark"] .notes-placeholder,
body[data-theme="dark"] .protected-feature-workspace-inner p,
body[data-theme="dark"] .notes-item-btn small,
body[data-theme="dark"] .notes-item-btn span,
body[data-theme="dark"] .notes-tree-meta small,
body[data-theme="dark"] .notes-search-meta,
body[data-theme="dark"] .notes-search-result-btn small,
body[data-theme="dark"] .notes-search-result-btn span,
body[data-theme="dark"] .notes-color-field,
body[data-theme="dark"] .notes-auth-status {
  color: #bcd0e6;
}

body[data-theme="dark"] .notes-auth-head h3,
body[data-theme="dark"] .protected-feature-workspace-inner h3,
body[data-theme="dark"] .notes-auth-session strong,
body[data-theme="dark"] .notes-tree-meta strong,
body[data-theme="dark"] .notes-search-result-btn strong,
body[data-theme="dark"] .notes-item-btn strong {
  color: #edf5ff;
}

body[data-theme="dark"] .protected-data-item,
body[data-theme="dark"] .protected-data-placeholder {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
}

body[data-theme="dark"] .protected-data-item-meta small,
body[data-theme="dark"] .protected-data-item-meta span,
body[data-theme="dark"] .protected-data-status {
  color: #bcd0e6;
}

body[data-theme="dark"] .protected-data-item-meta strong {
  color: #edf5ff;
}

body[data-theme="dark"] .website-collection-tag {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
  color: #eaf4ff;
}

body[data-theme="dark"] .website-collection-tag:hover {
  border-color: #80d8d1;
}

body[data-theme="dark"] .website-collection-tag.is-active {
  border-color: #69d6cf;
  background:
    linear-gradient(150deg, rgba(15, 52, 82, 0.96), rgba(13, 44, 72, 0.92)),
    linear-gradient(176deg, rgba(77, 197, 184, 0.24), rgba(79, 151, 230, 0.16));
  color: #f0fbff;
}

body[data-theme="dark"] .website-collection-tags-nav {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
  color: #eaf4ff;
}

body[data-theme="dark"] .website-collection-tags-nav:hover:not(:disabled) {
  border-color: #80d8d1;
}

body[data-theme="dark"] .website-collection-tags-viewport {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .website-collection-tags-viewport::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .website-collection-tags-viewport::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .website-collection-tags-viewport::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .website-collection-tags-shell.is-scrollable.can-scroll-left .website-collection-tags-viewport::before {
  background: linear-gradient(90deg, rgba(17, 46, 74, 0.98), rgba(17, 46, 74, 0));
}

body[data-theme="dark"] .website-collection-tags-shell.is-scrollable.can-scroll-right .website-collection-tags-viewport::after {
  background: linear-gradient(270deg, rgba(17, 46, 74, 0.98), rgba(17, 46, 74, 0));
}

body[data-theme="dark"] .website-collection-grid {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .website-collection-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .website-collection-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .website-collection-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .website-collection-card-type,
body[data-theme="dark"] .website-collection-empty,
body[data-theme="dark"] .website-add-status {
  color: #bcd0e6;
}

body[data-theme="dark"] .website-collection-card.is-search-hit {
  outline-color: rgba(255, 188, 133, 0.72);
}

body[data-theme="dark"] .website-collection-card.is-search-focus {
  outline-color: rgba(255, 146, 102, 0.92);
}

body[data-theme="dark"] .website-add-icon-panel {
  border-color: rgba(145, 192, 233, 0.34);
  background: #102942;
}

body[data-theme="dark"] .website-add-form button.website-add-icon-toggle,
body[data-theme="dark"] .website-add-icon-toggle-preview,
body[data-theme="dark"] .website-add-form button.website-add-icon-reset,
body[data-theme="dark"] .website-add-form button.website-add-icon-option,
body[data-theme="dark"] .website-add-form button.website-add-border-reset,
body[data-theme="dark"] .website-add-border-custom input[type="color"] {
  border-color: rgba(145, 192, 233, 0.34);
  background: #1a446d;
  color: #d8e8f8;
}

body[data-theme="dark"] .website-add-border-picker {
  border-color: var(--website-border-preview-color, rgba(145, 192, 233, 0.34));
  background: #1a446d;
}

body[data-theme="dark"] .website-add-form button.website-add-icon-option.is-selected,
body[data-theme="dark"] .website-add-form button.website-add-icon-reset.is-selected,
body[data-theme="dark"] .website-add-form button.website-add-border-reset.is-selected {
  border-color: #69d6cf;
  color: #9ff3ef;
}

body[data-theme="dark"] .website-add-border-title,
body[data-theme="dark"] .website-add-border-custom span {
  color: #bcd0e6;
}

body[data-theme="dark"] .website-add-form button.website-add-border-swatch {
  border-color: rgba(177, 214, 247, 0.62);
  background: var(--swatch-color, #4f87b8);
  box-shadow:
    0 0 0 1px rgba(4, 16, 30, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

body[data-theme="dark"] .website-add-form button.website-add-border-swatch:hover {
  border-color: rgba(220, 238, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(4, 16, 30, 0.78),
    0 0 0 2px rgba(76, 150, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

body[data-theme="dark"] .website-add-form button.website-add-border-swatch.is-selected {
  border-color: #d8e8f8;
  box-shadow:
    0 0 0 2px rgba(76, 150, 255, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

body[data-theme="dark"] .website-add-icon-grid {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .website-add-icon-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .website-add-icon-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .website-add-icon-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .website-collection-card-action {
  border: none;
  background: transparent;
  color: #bcd0e6;
  box-shadow: none;
}

body[data-theme="dark"] .website-collection-card-action:hover {
  background: transparent;
  color: #edf5ff;
  box-shadow: none;
}

body[data-theme="dark"] .website-collection-card-action.danger {
  color: #ffb4b4;
  background: transparent;
}

body[data-theme="dark"] .website-collection-card-action.edit {
  color: #9ec9f5;
  background: transparent;
}

body[data-theme="dark"] .website-collection-card-action.danger:hover {
  color: #ff8f8f;
}

body[data-theme="dark"] .website-collection-card-action.edit:hover {
  color: #c9e4ff;
}

body[data-theme="dark"] .website-add-status.is-error {
  color: #ff8f8f;
}

body[data-theme="dark"] .vault-file-card,
body[data-theme="dark"] .vault-file-item {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.9), rgba(11, 30, 52, 0.8)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.16), rgba(31, 218, 184, 0.08));
}

body[data-theme="dark"] .vault-file-brand,
body[data-theme="dark"] .vault-file-subtitle,
body[data-theme="dark"] .vault-file-tip,
body[data-theme="dark"] .vault-file-info,
body[data-theme="dark"] .vault-file-storage-usage,
body[data-theme="dark"] .vault-file-list-head span,
body[data-theme="dark"] .vault-preview-meta,
body[data-theme="dark"] .vault-preview-empty,
body[data-theme="dark"] .vault-preview-image-hint,
body[data-theme="dark"] .vault-preview-doc-hint,
body[data-theme="dark"] .vault-file-empty {
  color: #bcd0e6;
}

body[data-theme="dark"] .vault-file-name,
body[data-theme="dark"] .vault-file-list-head h4,
body[data-theme="dark"] .vault-preview-head h4 {
  color: #edf5ff;
}

body[data-theme="dark"] .vault-file-badge {
  border-color: rgba(145, 192, 233, 0.34);
  background: rgba(20, 56, 90, 0.72);
  color: #e5f2ff;
}

body[data-theme="dark"] .vault-file-badge.ok {
  border-color: rgba(92, 221, 194, 0.46);
  background: rgba(20, 114, 102, 0.25);
  color: #9ff7e4;
}

body[data-theme="dark"] .vault-file-badge.warn {
  border-color: rgba(236, 193, 101, 0.52);
  background: rgba(160, 118, 22, 0.28);
  color: #ffd89b;
}

body[data-theme="dark"] .vault-file-meta mark.notice-highlight {
  background: rgba(255, 202, 84, 0.46);
  color: #f6fbff;
}

body[data-theme="dark"] .vault-file-meta mark.notice-highlight.is-search-focus {
  background: rgba(255, 164, 46, 0.66);
}

body[data-theme="dark"] .vault-file-item.is-search-focus {
  border-color: rgba(94, 173, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(94, 173, 255, 0.26);
}

body[data-theme="dark"] .vault-file-item.is-preview-selected {
  border-color: rgba(94, 173, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(94, 173, 255, 0.3);
}

body[data-theme="dark"] .vault-preview-actions button,
body[data-theme="dark"] .vault-preview-open-card,
body[data-theme="dark"] .vault-preview-text-stage,
body[data-theme="dark"] .vault-preview-markdown-stage,
body[data-theme="dark"] .vault-preview-audio-wrap,
body[data-theme="dark"] .vault-preview-ppt-stage,
body[data-theme="dark"] .vault-preview-frame-wrap,
body[data-theme="dark"] .vault-preview-body {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.88), rgba(11, 30, 52, 0.78)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.14), rgba(31, 218, 184, 0.08));
}

body[data-theme="dark"] .vault-preview-frame {
  background: #0c2439;
}

body[data-theme="dark"] .vault-preview-ppt-toolbar button {
  border-color: rgba(145, 192, 233, 0.34);
}

body[data-theme="dark"] .vault-preview-ppt-canvas-wrap {
  border-color: rgba(145, 192, 233, 0.34);
  background: rgba(6, 20, 34, 0.82);
}

body[data-theme="dark"] .vault-preview-text mark.notice-highlight {
  background: rgba(255, 202, 84, 0.46);
  color: #f6fbff;
}

body[data-theme="dark"] .vault-preview-body mark.notice-highlight.is-search-focus {
  background: rgba(255, 187, 74, 0.66);
  color: #f6fbff;
}

body[data-theme="dark"] .vault-preview-markdown pre {
  background: rgba(6, 20, 34, 0.8);
  border-color: rgba(145, 192, 233, 0.34);
}

body[data-theme="dark"] .vault-preview-markdown th,
body[data-theme="dark"] .vault-preview-markdown td {
  border-color: rgba(145, 192, 233, 0.34);
}

body[data-theme="dark"] .vault-preview-markdown mark.notice-highlight {
  background: rgba(255, 202, 84, 0.46);
  color: #f6fbff;
}

body[data-theme="dark"] .vault-file-drop-zone {
  border-color: rgba(145, 192, 233, 0.42);
  background: rgba(14, 44, 72, 0.76);
}

body[data-theme="dark"] .vault-file-drop-zone.active {
  border-color: rgba(118, 205, 255, 0.7);
  background: rgba(17, 61, 96, 0.84);
  color: #e8f3ff;
}

body[data-theme="dark"] .notes-auth-tabs button,
body[data-theme="dark"] .notes-auth-form button,
body[data-theme="dark"] .notes-auth-session-actions button,
body[data-theme="dark"] .notes-workspace-head button,
body[data-theme="dark"] .notes-workspace-head select,
body[data-theme="dark"] .notes-toolbar-primary button,
body[data-theme="dark"] .notes-toolbar-more-toggle,
body[data-theme="dark"] .notes-toolbar-more-menu button,
body[data-theme="dark"] .notes-editor-mode button,
body[data-theme="dark"] .notes-source-mode button,
body[data-theme="dark"] .notes-rich-tools button,
body[data-theme="dark"] .notes-editor-actions button,
body[data-theme="dark"] .notes-color-field input[type="color"] {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .notes-editor-mode {
  border-color: rgba(140, 194, 243, 0.32);
  background: rgba(7, 27, 46, 0.84);
}

body[data-theme="dark"] .notes-source-mode {
  border-color: rgba(140, 194, 243, 0.32);
  background: rgba(7, 27, 46, 0.84);
}

body[data-theme="dark"] .notes-toolbar-main {
  border-color: rgba(140, 194, 243, 0.32);
  background: rgba(7, 27, 46, 0.84);
}

body[data-theme="dark"] .notes-toolbar-divider {
  background: rgba(140, 194, 243, 0.32);
}

body[data-theme="dark"] .notes-toolbar-more-menu {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.94), rgba(11, 30, 52, 0.84)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.14), rgba(31, 218, 184, 0.06));
}

body[data-theme="dark"] .notes-editor-mode button.is-active {
  background: rgba(70, 151, 229, 0.28);
  color: #e8f3ff;
}

body[data-theme="dark"] .notes-source-mode button.is-active {
  background: rgba(58, 176, 155, 0.3);
  color: #e8f3ff;
}

body[data-theme="dark"] .protected-data-form button,
body[data-theme="dark"] .protected-data-tools button,
body[data-theme="dark"] .protected-data-item-actions button {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .protected-data-tools button:last-of-type,
body[data-theme="dark"] .protected-data-item-actions button.danger {
  border-color: rgba(218, 109, 109, 0.62);
  color: #f2a8a8;
}

body[data-theme="dark"] .notes-auth-form input,
body[data-theme="dark"] .notes-workspace-head input,
body[data-theme="dark"] .notes-editor-meta input,
body[data-theme="dark"] .notes-editor-panel textarea,
body[data-theme="dark"] .notes-preview-pane {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .notes-auth-form input[type="password"] {
  color-scheme: dark;
}

body[data-theme="dark"] .notes-auth-form .notes-password-visibility-toggle {
  color: #ffffff;
  background: transparent;
}

body[data-theme="dark"] .notes-auth-form .notes-password-visibility-toggle:hover,
body[data-theme="dark"] .notes-auth-form .notes-password-visibility-toggle:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .notes-rich-editor pre {
  background: rgba(4, 24, 42, 0.92);
  border-color: rgba(108, 167, 213, 0.22);
}

body[data-theme="dark"] .notes-rich-editor th,
body[data-theme="dark"] .notes-rich-editor td {
  border-color: rgba(140, 194, 243, 0.32);
}

body[data-theme="dark"] .notes-search-result-btn.is-active {
  border-color: rgba(89, 197, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(89, 197, 255, 0.26);
}

body[data-theme="dark"] .notes-search-result-btn.is-current {
  border-color: rgba(70, 198, 173, 0.62);
  box-shadow: inset 0 0 0 1px rgba(70, 198, 173, 0.26);
}

body[data-theme="dark"] .notes-search-result-btn.is-current.is-active {
  border-color: rgba(89, 197, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(89, 197, 255, 0.32),
    0 0 0 1px rgba(70, 198, 173, 0.26);
}

body[data-theme="dark"] .notes-placement-count {
  border-color: rgba(70, 198, 173, 0.45);
  background: rgba(30, 146, 127, 0.22);
  color: #b7f5ea;
}

body[data-theme="dark"] .notes-list.is-drop-root {
  box-shadow: inset 0 0 0 2px rgba(89, 197, 255, 0.52);
}

body[data-theme="dark"] .notes-preview-pane code:not(pre code) {
  background: rgba(89, 197, 255, 0.18);
}

body[data-theme="dark"] .notes-preview-pane .hljs {
  background: rgba(4, 22, 40, 0.94);
  border-color: rgba(108, 167, 213, 0.22);
  color: #d8ecff;
}

body[data-theme="dark"] .notes-preview-pane th,
body[data-theme="dark"] .notes-preview-pane td {
  border-color: rgba(140, 194, 243, 0.32);
}

body[data-theme="dark"] .notes-rich-editor:focus {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .notes-context-menu {
  border-color: rgba(145, 192, 233, 0.34);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.94), rgba(11, 30, 52, 0.84)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.14), rgba(31, 218, 184, 0.06));
}

body[data-theme="dark"] .notes-context-menu button:not(:disabled):hover {
  border-color: rgba(89, 197, 255, 0.46);
  background: rgba(89, 197, 255, 0.12);
}

body[data-theme="dark"] .notes-rich-tools-config,
body[data-theme="dark"] .notes-rich-tools-config-head button,
body[data-theme="dark"] .notes-rich-tools-config-toggle {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .notes-toolbar-more-toggle.is-active {
  border-color: rgba(70, 198, 173, 0.54);
  background: rgba(30, 146, 127, 0.22);
}

body[data-theme="dark"] .notes-rich-tools-config-toggle.is-active {
  border-color: rgba(70, 198, 173, 0.54);
  background: rgba(30, 146, 127, 0.22);
}

body[data-theme="dark"] .notes-rich-tools-option {
  color: #bcd0e6;
}

body[data-theme="dark"] .protected-data-form input,
body[data-theme="dark"] .protected-data-form select,
body[data-theme="dark"] .protected-data-form textarea {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-workspace-head input {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-workspace-head button {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-search-action.is-active,
body[data-theme="dark"] .tasks-alarm-toggle.is-active {
  border-color: rgba(94, 173, 255, 0.68);
  background: linear-gradient(140deg, rgba(70, 151, 229, 0.32), rgba(30, 146, 127, 0.2));
  box-shadow: inset 0 0 0 1px rgba(94, 173, 255, 0.3);
}

body[data-theme="dark"] .tasks-alarm-modal {
  border-color: rgba(140, 194, 243, 0.32);
  background:
    linear-gradient(150deg, rgba(15, 40, 66, 0.92), rgba(11, 30, 52, 0.84)),
    linear-gradient(176deg, rgba(79, 151, 230, 0.14), rgba(31, 218, 184, 0.06));
}

body[data-theme="dark"] .tasks-alarm-time {
  border-color: rgba(140, 194, 243, 0.34);
  background: linear-gradient(145deg, rgba(33, 102, 165, 0.42), rgba(20, 114, 102, 0.28));
  box-shadow: inset 0 0 0 1px rgba(94, 173, 255, 0.26);
}

body[data-theme="dark"] .tasks-alarm-close {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-alarm-form input[type="date"],
body[data-theme="dark"] .tasks-alarm-form input[type="time"],
body[data-theme="dark"] .tasks-alarm-form select {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-alarm-form input[type="date"],
body[data-theme="dark"] .tasks-alarm-form input[type="time"] {
  color-scheme: dark;
}

body[data-theme="dark"] .tasks-alarm-form input[type="date"]::-webkit-datetime-edit,
body[data-theme="dark"] .tasks-alarm-form input[type="time"]::-webkit-datetime-edit {
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-alarm-form input[type="date"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] .tasks-alarm-form input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  filter: none;
}

body[data-theme="dark"] .tasks-alarm-time-picker {
  color: #ffd84d;
  background: rgba(255, 216, 77, 0.08);
}

body[data-theme="dark"] .tasks-alarm-time-picker:hover,
body[data-theme="dark"] .tasks-alarm-time-picker:focus-visible {
  color: #ffe77a;
  background: rgba(255, 216, 77, 0.2);
}

body[data-theme="dark"] .tasks-alarm-field input:disabled {
  background: rgba(7, 27, 46, 0.65);
}

body[data-theme="dark"] .tasks-alarm-mode-row {
  border-color: rgba(140, 194, 243, 0.34);
  background: rgba(8, 24, 40, 0.58);
}

body[data-theme="dark"] .tasks-alarm-mode-option {
  border-color: rgba(140, 194, 243, 0.34);
  background: rgba(7, 27, 46, 0.86);
}

body[data-theme="dark"] .tasks-alarm-mode-option input:checked + span {
  color: #86d4ff;
}

body[data-theme="dark"] .tasks-alarm-clear {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #bcd0e6;
}

body[data-theme="dark"] .tasks-alarm-submit {
  background: linear-gradient(145deg, rgba(70, 151, 229, 0.84), rgba(30, 146, 127, 0.82));
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-alarm-list {
  border-color: rgba(140, 194, 243, 0.32);
  background: rgba(8, 24, 40, 0.68);
  scrollbar-color: rgba(106, 189, 255, 0.52) transparent;
}

body[data-theme="dark"] .tasks-alarm-list::-webkit-scrollbar-thumb {
  background: rgba(106, 189, 255, 0.52);
}

body[data-theme="dark"] .tasks-alarm-item {
  border-color: rgba(140, 194, 243, 0.3);
  background: rgba(7, 27, 46, 0.88);
}

body[data-theme="dark"] .tasks-alarm-item-delete {
  border-color: rgba(235, 142, 142, 0.46);
  background: rgba(126, 45, 45, 0.34);
  color: #ffb9b9;
}

body[data-theme="dark"] .tasks-alarm-status.is-error {
  color: #ff9f9f;
}

body[data-theme="dark"] .tasks-alarm-ring-modal {
  border-color: rgba(255, 178, 109, 0.52);
  background: linear-gradient(150deg, rgba(57, 35, 16, 0.94), rgba(37, 23, 11, 0.9));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.46);
}

body[data-theme="dark"] .tasks-alarm-ring-modal p {
  color: #ffd7b9;
}

body[data-theme="dark"] .tasks-alarm-ring-modal button {
  border-color: rgba(250, 167, 147, 0.46);
  background: linear-gradient(145deg, rgba(209, 90, 72, 0.96), rgba(187, 65, 65, 0.94));
  color: #fff6f0;
}

body[data-theme="dark"] .tasks-list-panel,
body[data-theme="dark"] .tasks-editor-panel {
  border-color: rgba(140, 194, 243, 0.3);
  background: rgba(7, 27, 46, 0.72);
}

body[data-theme="dark"] .tasks-calendar-head button {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-calendar-weekdays li,
body[data-theme="dark"] .tasks-selected-date {
  color: #bcd0e6;
}

body[data-theme="dark"] .tasks-calendar-cell {
  border-color: rgba(140, 194, 243, 0.24);
  background: rgba(10, 33, 54, 0.56);
}

body[data-theme="dark"] .tasks-calendar-cell.is-selected {
  border-color: rgba(119, 196, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(119, 196, 255, 0.2);
  background: linear-gradient(160deg, rgba(23, 61, 96, 0.8), rgba(14, 43, 73, 0.62));
}

body[data-theme="dark"] .tasks-calendar-cell.is-search-hit {
  border-color: rgba(241, 176, 73, 0.64);
  box-shadow: inset 0 0 0 1px rgba(241, 176, 73, 0.28);
}

body[data-theme="dark"] .tasks-calendar-cell.is-search-focus {
  border-color: rgba(251, 138, 80, 0.72);
  box-shadow: inset 0 0 0 2px rgba(251, 138, 80, 0.34);
}

body[data-theme="dark"] .tasks-calendar-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(107, 220, 190, 0.28);
}

body[data-theme="dark"] .tasks-calendar-cell.is-today-glow {
  border-color: rgba(123, 236, 209, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(123, 236, 209, 0.56),
    0 0 0 1px rgba(123, 236, 209, 0.46),
    0 0 24px rgba(82, 217, 182, 0.62);
}

body[data-theme="dark"] .tasks-calendar-count {
  border-color: rgba(119, 196, 255, 0.44);
  background: rgba(33, 102, 165, 0.3);
  color: #d6edff;
}

body[data-theme="dark"] .tasks-calendar-title {
  color: #bcd0e6;
}

body[data-theme="dark"] .tasks-calendar-title mark {
  background: rgba(241, 176, 73, 0.42);
}

body[data-theme="dark"] .tasks-calendar-title.is-search-focus mark {
  background: rgba(251, 138, 80, 0.45);
}

body[data-theme="dark"] .tasks-calendar-inline-input {
  color: #e8f3ff;
  background: transparent;
}

body[data-theme="dark"] .tasks-calendar-inline-input:focus {
  border: 0;
  box-shadow: none;
}

body[data-theme="dark"] .tasks-calendar-view-switch {
  border-color: rgba(140, 194, 243, 0.32);
  background: rgba(7, 27, 46, 0.84);
}

body[data-theme="dark"] .tasks-calendar-view-switch button.is-active {
  background: rgba(70, 151, 229, 0.28);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-calendar-cell.is-in-range {
  border-color: rgba(119, 196, 255, 0.44);
  background: linear-gradient(160deg, rgba(23, 60, 95, 0.68), rgba(14, 43, 73, 0.56));
}

body[data-theme="dark"] .tasks-calendar-quick-form {
  border-color: rgba(140, 194, 243, 0.3);
  background: rgba(7, 27, 46, 0.74);
}

body[data-theme="dark"] .tasks-calendar-quick-label {
  color: #bcd0e6;
}

body[data-theme="dark"] .tasks-calendar-quick-row input,
body[data-theme="dark"] .tasks-calendar-quick-row button {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .tasks-calendar-quick-row input:focus {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .notes-auth-form input:focus,
body[data-theme="dark"] .notes-workspace-head input:focus,
body[data-theme="dark"] .notes-editor-meta input:focus,
body[data-theme="dark"] .notes-editor-panel textarea:focus {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .protected-data-form input:focus,
body[data-theme="dark"] .protected-data-form select:focus,
body[data-theme="dark"] .protected-data-form textarea:focus {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .tasks-workspace-head input:focus {
  border-color: rgba(89, 197, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(89, 197, 255, 0.22);
}

body[data-theme="dark"] .tasks-overview {
  border-color: rgba(140, 194, 243, 0.3);
  background: rgba(7, 27, 46, 0.88);
  color: #bcd0e6;
}

body[data-theme="dark"] .tasks-list .protected-data-item.is-active {
  border-color: rgba(119, 196, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(119, 196, 255, 0.24);
}

body[data-theme="dark"] .protected-data-item.is-overdue {
  border-color: rgba(222, 122, 122, 0.56);
  background: linear-gradient(160deg, rgba(74, 20, 31, 0.72), rgba(43, 17, 24, 0.62));
}

body[data-theme="dark"] .protected-data-item.is-today {
  border-color: rgba(232, 182, 90, 0.48);
  background: linear-gradient(160deg, rgba(78, 54, 20, 0.66), rgba(46, 33, 13, 0.56));
}

body[data-theme="dark"] .tasks-form-grid label {
  color: #bcd0e6;
}

body[data-theme="dark"] .notes-list-panel {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .notes-auth-modal {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .protected-data-list {
  scrollbar-color: rgba(149, 193, 229, 0.7) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .notes-list-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .notes-auth-modal::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .protected-data-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .notes-list-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .notes-auth-modal::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .protected-data-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .notes-list-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .notes-auth-modal::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .protected-data-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .notes-auth-close-btn {
  border-color: rgba(140, 194, 243, 0.38);
  background: rgba(7, 27, 46, 0.9);
  color: #e8f3ff;
}

body[data-theme="dark"] .notes-auth-placeholder > button {
  border-color: rgba(129, 205, 255, 0.54);
  background: linear-gradient(160deg, rgba(37, 206, 174, 0.88), rgba(63, 148, 255, 0.82));
  color: #f1fbff;
  box-shadow: 0 16px 30px rgba(2, 18, 42, 0.46);
}

body[data-theme="dark"] .top-chip-icon.is-authenticated {
  border-color: rgba(65, 232, 203, 0.62);
  box-shadow: inset 0 0 0 1px rgba(65, 232, 203, 0.28), var(--shadow-soft);
}

body[data-theme="dark"] .ai-assistant-head,
body[data-theme="dark"] .ai-model-bar,
body[data-theme="dark"] .ai-system-prompt,
body[data-theme="dark"] .ai-display-canvas,
body[data-theme="dark"] .ai-history-panel,
body[data-theme="dark"] .ai-main-pane,
body[data-theme="dark"] .ai-quick-bar,
body[data-theme="dark"] .ai-chat-panel,
body[data-theme="dark"] .ai-composer,
body[data-theme="dark"] .ai-welcome-card,
body[data-theme="dark"] .ai-message,
body[data-theme="dark"] .ai-history-item-btn {
  background: linear-gradient(145deg, rgba(8, 28, 46, 0.86), rgba(7, 22, 35, 0.74));
  border-color: rgba(127, 179, 226, 0.35);
}

body[data-theme="dark"] .ai-slash-panel {
  background: linear-gradient(145deg, rgba(9, 30, 49, 0.92), rgba(7, 24, 39, 0.86));
  border-color: rgba(127, 179, 226, 0.38);
}

body[data-theme="dark"] #aiSlashBackButton,
body[data-theme="dark"] .ai-slash-card {
  background: rgba(7, 27, 46, 0.92);
  border-color: rgba(125, 183, 236, 0.34);
  color: #ecf6ff;
}

body[data-theme="dark"] .ai-slash-card small,
body[data-theme="dark"] .ai-slash-hint,
body[data-theme="dark"] .ai-slash-empty {
  color: #bcd0e6;
}

body[data-theme="dark"] .ai-field input,
body[data-theme="dark"] .ai-field select,
body[data-theme="dark"] .ai-quick-model-field select,
body[data-theme="dark"] .ai-web-search-engine-select,
body[data-theme="dark"] .ai-system-prompt textarea,
body[data-theme="dark"] #aiMessageInput,
body[data-theme="dark"] .ai-api-form input,
body[data-theme="dark"] #aiApiProfileSelect {
  background: rgba(7, 27, 46, 0.9);
  border-color: rgba(125, 183, 236, 0.34);
  color: #ecf6ff;
}

body[data-theme="dark"] .ai-system-prompt textarea {
  color-scheme: dark;
  scrollbar-color: rgba(159, 207, 241, 0.86) rgba(7, 27, 46, 0.92);
}

body[data-theme="dark"] .ai-system-prompt textarea::-webkit-scrollbar-track {
  background: rgba(7, 27, 46, 0.92);
  border-left-color: rgba(120, 181, 236, 0.28);
}

body[data-theme="dark"] .ai-system-prompt textarea::-webkit-scrollbar-thumb {
  border-color: rgba(8, 28, 46, 0.94);
  background: linear-gradient(180deg, rgba(170, 214, 244, 0.9), rgba(114, 170, 217, 0.84));
}

body[data-theme="dark"] .ai-system-prompt textarea::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(188, 226, 251, 0.96), rgba(132, 190, 235, 0.9));
}

body[data-theme="dark"] .ai-system-prompt textarea::-webkit-scrollbar-button,
body[data-theme="dark"] .ai-system-prompt textarea::-webkit-scrollbar-corner {
  background: rgba(7, 27, 46, 0.94);
}

body[data-theme="dark"] #aiApiProfileSelect {
  color-scheme: dark;
}

body[data-theme="dark"] #aiApiProfileSelect option,
body[data-theme="dark"] #aiApiProfileSelect optgroup {
  background-color: #0b2740;
  color: #ecf6ff;
}

body[data-theme="dark"] .ai-provider-switch,
body[data-theme="dark"] .ai-agent-mode-switch,
body[data-theme="dark"] .ai-connection-pill,
body[data-theme="dark"] .ai-provider-switch button,
body[data-theme="dark"] .ai-agent-mode-switch button,
body[data-theme="dark"] .ai-mode-switch button,
body[data-theme="dark"] .ai-head-actions button,
body[data-theme="dark"] .ai-quick-actions button,
body[data-theme="dark"] .ai-history-head button,
body[data-theme="dark"] .ai-composer-actions button,
body[data-theme="dark"] .ai-web-search-toggle,
body[data-theme="dark"] .ai-attachment-row button,
body[data-theme="dark"] .ai-api-modal-close {
  background: rgba(7, 27, 46, 0.88);
  border-color: rgba(123, 180, 230, 0.34);
  color: #eaf5ff;
}

body[data-theme="dark"] .ai-provider-radio {
  border-color: rgba(123, 180, 230, 0.62);
  background: rgba(7, 27, 46, 0.9);
}

body[data-theme="dark"] .ai-provider-switch button.is-active .ai-provider-radio {
  border-color: rgba(128, 210, 255, 0.8);
  box-shadow: inset 0 0 0 3.8px rgba(128, 210, 255, 0.95);
}

body[data-theme="dark"] .ai-quick-model-count {
  background: rgba(7, 27, 46, 0.88);
  border-color: rgba(123, 180, 230, 0.34);
  color: #dbeeff;
}

body[data-theme="dark"] .ai-provider-switch button.is-active,
body[data-theme="dark"] .ai-agent-mode-switch button.is-active,
body[data-theme="dark"] .ai-mode-switch button.is-active,
body[data-theme="dark"] .ai-composer-actions #aiSendButton,
body[data-theme="dark"] .ai-history-head button.is-active,
body[data-theme="dark"] .ai-history-item.is-active .ai-history-item-btn {
  background: linear-gradient(145deg, rgba(20, 113, 232, 0.4), rgba(10, 163, 146, 0.34));
  border-color: rgba(117, 210, 255, 0.54);
}

body[data-theme="dark"] .ai-history-item.is-selected .ai-history-item-btn {
  border-color: rgba(120, 210, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(120, 210, 255, 0.2);
  background: linear-gradient(145deg, rgba(20, 113, 232, 0.34), rgba(10, 163, 146, 0.28));
}

body[data-theme="dark"] .ai-history-item.is-search-hit .ai-history-item-btn {
  border-color: rgba(255, 156, 110, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 156, 110, 0.2);
  background: linear-gradient(145deg, rgba(214, 104, 56, 0.34), rgba(162, 116, 34, 0.26));
}

body[data-theme="dark"] .ai-history-item.is-search-focus .ai-history-item-btn {
  border-color: rgba(255, 159, 113, 0.8);
  box-shadow: inset 0 0 0 2px rgba(255, 159, 113, 0.3);
}

body[data-theme="dark"] .ai-history-list {
  scrollbar-color: rgba(136, 191, 232, 0.74) rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .ai-history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .ai-history-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(151, 193, 228, 0.78), rgba(108, 160, 208, 0.72));
}

body[data-theme="dark"] .ai-history-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(170, 208, 239, 0.9), rgba(124, 180, 226, 0.82));
}

body[data-theme="dark"] .ai-web-search-toggle.is-enabled {
  background: linear-gradient(145deg, rgba(19, 139, 84, 0.5), rgba(14, 116, 72, 0.38));
  border-color: rgba(122, 233, 176, 0.68);
  color: #e9fff4;
  box-shadow: inset 0 0 0 1px rgba(122, 233, 176, 0.2);
}

body[data-theme="dark"] .ai-message-body pre {
  background: rgba(4, 17, 32, 0.92);
  border-color: rgba(114, 176, 233, 0.32);
}

body[data-theme="dark"] .ai-message-body a {
  color: #8fe7ff;
  text-decoration-color: rgba(143, 231, 255, 0.62);
}

body[data-theme="dark"] .ai-message-body a:hover {
  color: #bef3ff;
  text-decoration-color: rgba(190, 243, 255, 0.84);
}

body[data-theme="dark"] .ai-message-body a:visited {
  color: #a8dfff;
}

body[data-theme="dark"] .ai-search-audit-card {
  background: linear-gradient(152deg, rgba(10, 54, 86, 0.3), rgba(9, 44, 66, 0.26));
  border-color: rgba(124, 183, 233, 0.34);
}

body[data-theme="dark"] .ai-search-audit-card summary {
  background: rgba(8, 27, 46, 0.84);
  border-bottom-color: rgba(124, 183, 233, 0.3);
}

body[data-theme="dark"] .ai-search-audit-card summary::before {
  color: #b7dfff;
}

body[data-theme="dark"] .ai-search-audit-meta p {
  color: #c8deef;
}

body[data-theme="dark"] .ai-search-audit-list li {
  background: rgba(8, 24, 40, 0.74);
  border-color: rgba(122, 182, 232, 0.3);
}

body[data-theme="dark"] .ai-message.is-search-focus {
  border-color: rgba(255, 147, 93, 0.78);
  box-shadow: inset 0 0 0 2px rgba(255, 147, 93, 0.28);
}

body[data-theme="dark"] .ai-message-body mark.notice-highlight,
body[data-theme="dark"] .ai-history-item-btn mark.notice-highlight {
  background: rgba(255, 203, 79, 0.34);
}

body[data-theme="dark"] .ai-api-modal {
  background: linear-gradient(152deg, rgba(8, 30, 49, 0.95), rgba(7, 22, 36, 0.92));
  border-color: rgba(124, 183, 233, 0.36);
}

body[data-theme="dark"] .ai-main-pane {
  background: transparent;
  border: 0;
}

body[data-theme="dark"] .ai-runtime-status.is-error,
body[data-theme="dark"] .ai-api-status.is-error {
  color: #ff8f8f;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 20, 36, 0.52);
  backdrop-filter: blur(4px);
}

.tasks-search-backdrop {
  z-index: 74;
}

.tasks-search-modal {
  width: min(640px, 94vw);
  max-height: min(72vh, 720px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--panel-bg-strong);
  box-shadow: var(--shadow-panel);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.tasks-search-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tasks-search-modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.tasks-search-modal-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.tasks-search-modal-meta {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--step--1);
}

.tasks-search-modal-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: min(58vh, 560px);
  overflow: auto;
  min-height: 0;
}

.tasks-search-modal-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.tasks-search-modal-item.is-active {
  border-color: rgba(14, 110, 232, 0.54);
  background: linear-gradient(140deg, rgba(14, 110, 232, 0.16), rgba(10, 143, 131, 0.1));
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.2);
}

.tasks-search-modal-item-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tasks-search-modal-item-main strong {
  font-size: var(--step--1);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tasks-search-modal-item-main small {
  font-size: 0.72rem;
  color: var(--text-subtle);
  overflow-wrap: anywhere;
}

.tasks-search-modal-item button {
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--chip-bg);
  color: inherit;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
}

.tasks-search-action.is-active,
.tasks-alarm-toggle.is-active {
  border-color: rgba(14, 110, 232, 0.54);
  background: linear-gradient(140deg, rgba(14, 110, 232, 0.16), rgba(10, 143, 131, 0.1));
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.2);
}

.tasks-alarm-backdrop {
  z-index: 80;
}

.tasks-alarm-modal {
  width: min(430px, 96vw);
  max-height: min(84vh, 780px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--panel-bg-strong);
  box-shadow: var(--shadow-panel);
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow: hidden;
}

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

.tasks-alarm-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.tasks-alarm-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tasks-alarm-close {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.tasks-alarm-close {
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  line-height: 1;
}

.tasks-alarm-time {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(14, 110, 232, 0.18), rgba(10, 143, 131, 0.12));
  box-shadow: inset 0 0 0 1px rgba(14, 110, 232, 0.16);
  padding: 12px 14px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.34rem + 2vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: 0.02em;
}

.tasks-alarm-form {
  display: grid;
  gap: 10px;
}

.tasks-alarm-schedule-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tasks-alarm-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.tasks-alarm-field > span {
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.tasks-alarm-form input[type="date"],
.tasks-alarm-form input[type="time"],
.tasks-alarm-form select,
.tasks-alarm-form-actions button {
  min-height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  font-family: inherit;
}

.tasks-alarm-form input[type="date"],
.tasks-alarm-form input[type="time"],
.tasks-alarm-form select {
  background: var(--chip-bg);
  color: inherit;
  padding: 0 10px;
  font-size: 0.9rem;
}

.tasks-alarm-field input:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.tasks-alarm-date-field,
.tasks-alarm-time-field {
  position: relative;
  min-width: 0;
}

.tasks-alarm-date-field input,
.tasks-alarm-time-field input {
  width: 100%;
  padding-right: 36px;
}

/* Hide unstable native icon and rely on explicit picker button for consistent cross-theme display. */
.tasks-alarm-date-field input[type="date"]::-webkit-calendar-picker-indicator,
.tasks-alarm-time-field input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
}

.tasks-alarm-time-picker {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 2;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(35, 64, 95, 0.74);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.tasks-alarm-time-picker svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tasks-alarm-time-picker:hover,
.tasks-alarm-time-picker:focus-visible {
  color: var(--accent-strong);
  background: rgba(14, 110, 232, 0.12);
  outline: none;
}

.tasks-alarm-time-picker:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tasks-alarm-form input[type="date"]:focus,
.tasks-alarm-form input[type="time"]:focus,
.tasks-alarm-form select:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.tasks-alarm-mode-row {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.28);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.tasks-alarm-mode-option {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  min-height: 36px;
}

.tasks-alarm-mode-option input {
  margin: 0;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  appearance: auto;
  flex: 0 0 auto;
  accent-color: var(--accent-strong);
}

.tasks-alarm-mode-option span {
  font-size: 0.82rem;
  font-weight: 620;
}

.tasks-alarm-mode-option input:checked + span {
  color: var(--accent-strong);
}

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

.tasks-alarm-sound-field select {
  width: 100%;
}

.tasks-alarm-form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tasks-alarm-clear,
.tasks-alarm-submit {
  width: 100%;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.tasks-alarm-clear {
  background: var(--chip-bg);
  color: var(--text-subtle);
}

.tasks-alarm-submit {
  background: linear-gradient(145deg, rgba(14, 110, 232, 0.9), rgba(10, 143, 131, 0.9));
  border-color: transparent;
  color: var(--text-inverse);
}

.tasks-alarm-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.16));
  min-height: 120px;
  max-height: min(44vh, 360px);
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 110, 232, 0.45) transparent;
}

.tasks-alarm-list::-webkit-scrollbar {
  width: 10px;
}

.tasks-alarm-list::-webkit-scrollbar-track {
  background: transparent;
}

.tasks-alarm-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgba(14, 110, 232, 0.42);
  background-clip: padding-box;
}

.tasks-alarm-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--chip-bg);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.tasks-alarm-item-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tasks-alarm-item-time {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.2;
}

.tasks-alarm-item-meta {
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.tasks-alarm-item-delete {
  min-height: 30px;
  border: 1px solid rgba(198, 92, 92, 0.45);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(205, 72, 72, 0.14), rgba(205, 72, 72, 0.08));
  color: #b63d3d;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.tasks-alarm-empty {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.84rem;
  line-height: 1.45;
}

.tasks-alarm-status {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.76rem;
}

.tasks-alarm-status.is-error {
  color: #c94b4b;
}

.tasks-alarm-ring-backdrop {
  z-index: 95;
}

.tasks-alarm-ring-modal {
  width: min(420px, 92vw);
  border: 1px solid rgba(251, 148, 86, 0.5);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(255, 253, 247, 0.98), rgba(255, 245, 234, 0.94));
  box-shadow: 0 18px 40px rgba(145, 73, 29, 0.26);
  padding: 18px 16px;
  text-align: center;
  display: grid;
  gap: 10px;
}

.tasks-alarm-ring-modal h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
}

.tasks-alarm-ring-modal p {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.88rem;
}

.tasks-alarm-ring-modal button {
  min-height: 38px;
  border: 1px solid rgba(198, 92, 92, 0.45);
  border-radius: 10px;
  background: linear-gradient(145deg, #d95f4b, #c84a4a);
  color: #fff8f4;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.modal {
  width: min(560px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: var(--panel-bg-strong);
  box-shadow: var(--shadow-panel);
  padding: clamp(16px, 2vw, 24px);
}

.modal.network-image-modal {
  width: min(351px, 63.45vw);
}

.modal.website-add-modal {
  width: min(426px, 94vw);
  display: grid;
  gap: 10px;
}

.website-add-icon-picker {
  position: relative;
}

.website-add-form button.website-add-icon-toggle {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-family: inherit;
  font-size: var(--step--1);
  text-align: left;
  cursor: pointer;
}

.website-add-form button.website-add-icon-toggle:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(14, 110, 232, 0.16);
}

.website-add-icon-toggle-preview {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.website-add-icon-toggle-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.website-add-icon-toggle-arrow {
  color: var(--text-subtle);
  font-size: 0.84rem;
  transition: transform 0.14s ease;
}

.website-add-icon-picker.is-open .website-add-icon-toggle-arrow {
  transform: rotate(180deg);
}

.website-add-icon-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: #f4f9ff;
  box-shadow: var(--shadow-panel);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.website-add-form button.website-add-icon-reset {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.62);
  color: inherit;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}

.website-add-form button.website-add-icon-reset.is-selected {
  border-color: var(--accent-strong);
  color: var(--accent);
}

.website-add-border-picker {
  border: 1px solid var(--website-border-preview-color, var(--line-soft));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  padding: 8px;
  display: grid;
  gap: 8px;
  --website-border-preview-color: var(--line-soft);
}

.website-add-border-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.website-add-border-title {
  font-size: 0.74rem;
  color: var(--text-subtle);
  font-weight: 650;
}

.website-add-form button.website-add-border-reset {
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0 10px;
  cursor: pointer;
}

.website-add-form button.website-add-border-reset.is-selected {
  border-color: var(--accent-strong);
  color: var(--accent);
}

.website-add-border-swatches {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.website-add-form button.website-add-border-swatch {
  width: 100%;
  height: 22px;
  min-height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--swatch-color, #4f87b8);
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.website-add-form button.website-add-border-swatch:hover {
  transform: translateY(-1px);
}

.website-add-form button.website-add-border-swatch.is-selected {
  border-color: var(--text-main);
  box-shadow:
    0 0 0 2px rgba(14, 110, 232, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.website-add-border-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.website-add-border-custom span {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.website-add-border-custom input[type="color"] {
  width: 44px;
  min-width: 44px;
  height: 28px;
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  padding: 0;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.website-add-icon-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 58px;
  gap: 8px;
  max-height: calc(58px * 5 + 8px * 4);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 106, 156, 0.56) rgba(255, 255, 255, 0.14);
}

.website-add-icon-grid::-webkit-scrollbar {
  width: 8px;
}

.website-add-icon-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.website-add-icon-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(39, 130, 188, 0.72), rgba(31, 99, 168, 0.68));
}

.website-add-icon-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(49, 151, 210, 0.84), rgba(35, 113, 188, 0.78));
}

.website-add-form button.website-add-icon-option {
  width: 54px;
  height: 48px;
  min-height: 48px;
  border-radius: 12px;
  border: 1.5px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.62);
  color: inherit;
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  position: relative;
  overflow: hidden;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
}

.website-add-form button.website-add-icon-option::after {
  content: none;
  display: none;
}

.website-add-form button.website-add-icon-option:hover {
  border-color: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(14, 110, 232, 0.16);
}

.website-add-form button.website-add-icon-option.is-selected {
  border-color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.34);
}

#websiteAddSubmitButton {
  width: 80px;
  height: 80px;
  min-height: 80px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: linear-gradient(145deg, rgba(14, 110, 232, 0.9), rgba(10, 143, 131, 0.9));
  color: var(--text-inverse);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: grid;
  place-items: center;
  justify-self: center;
  padding: 0;
  cursor: pointer;
}

#websiteAddSubmitButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(13, 109, 196, 0.26);
}

#websiteAddSubmitButton:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(14, 110, 232, 0.2),
    0 10px 22px rgba(13, 109, 196, 0.26);
}

@media (max-width: 560px) {
  #websiteAddSubmitButton {
    width: 80px;
    height: 80px;
    min-height: 80px;
    font-size: 0.94rem;
  }
}

.website-add-status {
  margin: 0;
  min-height: 18px;
  color: var(--text-subtle);
  font-size: 0.76rem;
}

.website-add-status.is-error {
  color: #c94b4b;
}

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

.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
}

.modal-head button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  font-size: 1.3rem;
  cursor: pointer;
}

.modal p {
  margin: 12px 0 14px;
  color: var(--text-subtle);
  font-size: var(--step-0);
}

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

.bg-option {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--panel-bg-strong);
  color: inherit;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  cursor: pointer;
}

.bg-option strong {
  font-size: var(--step--1);
}

.bg-option.is-selected {
  border-color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.45);
}

.swatch {
  width: 48px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.swatch.mist {
  background: radial-gradient(circle at 18% 20%, #f5fffc 0, #e2eff5 44%, #cfdeeb 100%);
}

.swatch.dawn {
  background: radial-gradient(circle at 18% 20%, #fff7eb 0, #f1e3cc 44%, #ddd8e8 100%);
}

.swatch.qinglv {
  background: radial-gradient(circle at 18% 20%, #ecfbf6 0, #d9f1e8 44%, #c4e3d8 100%);
}

.swatch.mihuang {
  background: radial-gradient(circle at 18% 20%, #fff9eb 0, #f2e6c8 44%, #e4d4ab 100%);
}

.swatch.hailan {
  background: radial-gradient(circle at 18% 20%, #e9f6ff 0, #d3e8f8 44%, #bdd7ec 100%);
}

.swatch.huifen {
  background: radial-gradient(circle at 18% 20%, #fbf2f7 0, #ecdce6 44%, #dcc8d7 100%);
}

.swatch.gradient {
  background: linear-gradient(135deg, #dff6ff 0%, #e8f4f0 30%, #efe8ff 68%, #f9ecdc 100%);
}

.swatch.flow-gradient {
  background: linear-gradient(130deg, #dff6ff 0%, #d2eef0 26%, #e9ddff 52%, #ffdcdc 76%, #fff0ba 100%);
}

.bg-image-tools {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 10px;
}

.bg-image-tools h4 {
  margin: 0;
  font-size: var(--step--1);
  font-family: var(--font-display);
}

.bg-image-mode {
  display: grid;
  gap: 6px;
}

.bg-image-mode > span {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.bg-image-mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bg-image-mode-option {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0 8px;
}

.bg-image-mode-option input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
}

.bg-image-mode-option:has(input[type="radio"]:checked) {
  border-color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 131, 0.42);
}

.bg-image-field {
  display: grid;
  gap: 5px;
}

.bg-image-field span {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.bg-image-source-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  cursor: pointer;
  user-select: none;
}

.bg-image-source-label input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
}

.bg-image-field input[type="file"],
.bg-image-url-row input {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.74);
  color: inherit;
  font: inherit;
  font-size: 0.74rem;
  padding: 6px 10px;
}

.bg-image-field input[type="file"]:disabled,
.bg-image-url-row input:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.bg-image-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.bg-image-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.bg-image-file-row button,
.bg-image-url-row button,
.bg-image-actions button {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--chip-bg);
  color: inherit;
  font: inherit;
  font-size: 0.74rem;
  padding: 0 10px;
  cursor: pointer;
}

.bg-image-file-row button:disabled,
.bg-image-url-row button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.bg-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bg-image-actions small {
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.bg-image-actions small.is-error {
  color: #b94d4d;
}

body.sidebar-collapsed {
  --sidebar-width: 74px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  width: auto;
  gap: 0;
}

body.sidebar-collapsed .sidebar-top {
  justify-content: center;
  padding: 10px 8px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .menu-label {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

body.sidebar-collapsed .menu-item,
body.sidebar-collapsed .utility-item {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .menu-item,
body.sidebar-collapsed .utility-item {
  position: relative;
}

body.sidebar-collapsed .menu-item:hover::after,
body.sidebar-collapsed .utility-item:hover::after {
  content: none !important;
}

body.sidebar-collapsed .sidebar-nav {
  overflow-x: hidden;
  overflow-y: auto;
}

body.sidebar-collapsed .sidebar-footer {
  overflow: hidden;
}

body.sidebar-collapsed .menu-item,
body.sidebar-collapsed .utility-item {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

@keyframes flow-gradient-bg {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes rise-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.stat-card,
.panel {
  animation: rise-up 0.5s ease both;
}

.stat-card:nth-child(2) {
  animation-delay: 0.05s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.1s;
}

.stat-card:nth-child(4) {
  animation-delay: 0.15s;
}

.panel:nth-child(2) {
  animation-delay: 0.08s;
}

@media (max-width: 1360px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    max-width: 24ch;
  }

  .notes-layout {
    grid-template-columns: 1fr;
  }

  .notes-editor-stage[data-mode="split"] {
    grid-template-columns: 1fr;
  }

  .tasks-layout {
    grid-template-columns: 1fr;
  }

  .local-grid {
    --local-visible-rows: 6;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .topbar {
    padding: 8px 16px;
  }

  .topbar-right {
    gap: 8px;
  }

  .topbar-view-search {
    flex-basis: min(44vw, 500px);
    min-width: clamp(220px, 24vw, 340px);
  }

  .local-transfer-toolbar {
    gap: 6px;
  }

  .topbar-view-search .view-search-meta {
    font-size: 0.72rem;
  }

  .visit-toggle {
    padding: 6px 10px;
  }

  .visit-label {
    font-size: 0.66rem;
  }

  .calendar-toggle {
    padding: 6px 10px;
  }

  .calendar-date {
    font-size: 0.64rem;
  }

  .content {
    padding-inline: 14px;
  }

  .notes-auth-form {
    align-items: stretch;
    flex-direction: column;
  }

  .notes-auth-form button {
    width: 100%;
  }

  .protected-data-form button {
    width: 100%;
  }

  .protected-data-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .protected-data-tools button {
    width: 100%;
  }

  .tasks-form-grid {
    grid-template-columns: 1fr;
  }

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

  .tasks-calendar-cell {
    min-height: 92px;
  }

  .tasks-workspace-head {
    grid-template-columns: 1fr;
  }

  .ai-assistant {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 220px) minmax(0, 1fr);
  }

  .ai-display-canvas {
    height: clamp(646px, 77vh, 910px);
    padding: clamp(8px, 1.8vw, 12px);
  }

  .ai-history-panel {
    min-height: 0;
  }

  .ai-assistant-head {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .ai-head-actions {
    justify-content: flex-start;
  }

  .ai-history-head-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .ai-settings-provider-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ai-settings-provider-row .ai-head-actions {
    margin-left: 0;
  }

  .ai-model-bar {
    grid-template-columns: 1fr;
  }

  .ai-mode-switch {
    justify-content: flex-start;
  }

  .ai-quick-model-field {
    width: 100%;
  }

  .ai-quick-model-inline {
    width: 100%;
  }

  .ai-quick-model-field select {
    min-width: 0;
    width: 100%;
  }

  .ai-quick-mode-select {
    width: auto !important;
    min-width: 92px !important;
    margin-left: auto;
  }

  .ai-quick-model-count {
    margin-left: auto;
  }

  .ai-agent-mode-switch {
    width: 100%;
    justify-content: flex-start;
  }

  .ai-quick-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .ai-composer-bottom {
    align-items: stretch;
  }

  .ai-attachment-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .ai-web-search-wrap {
    width: 100%;
    justify-content: flex-end;
  }

  .ai-composer-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

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

  .tasks-calendar-quick-row {
    grid-template-columns: 1fr;
  }

  .notes-auth-placeholder {
    min-height: clamp(360px, 62vh, 560px);
    padding: 14px;
  }

  .protected-feature-workspace {
    min-height: clamp(360px, 62vh, 560px);
    padding: 18px;
  }

  .notes-workspace-head {
    grid-template-columns: 1fr;
  }

  .notes-editor-mode {
    width: 100%;
  }

  .notes-editor-mode button {
    width: 100%;
  }

  .notes-source-mode {
    width: 100%;
  }

  .notes-source-mode button {
    width: 100%;
  }

  .notes-editor-toolbar {
    width: 100%;
  }

  .notes-toolbar-main {
    flex-wrap: wrap;
  }

  .notes-toolbar-divider {
    display: none;
  }

  .notes-toolbar-primary {
    flex-wrap: wrap;
  }

  .notes-toolbar-overflow {
    margin-left: auto;
  }

  .notes-toolbar-more-menu {
    right: 0;
    left: auto;
    min-width: 164px;
  }

  .notes-rich-tools {
    order: 3;
    flex-basis: 100%;
  }

  .notes-rich-tools-config-toggle {
    width: 100%;
  }

  .notes-toolbar-modes {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .notes-editor-meta {
    grid-template-columns: 1fr;
  }

  .protected-data-item {
    grid-template-columns: 1fr;
  }

  .protected-data-item-actions {
    justify-content: flex-end;
  }

  .local-add-form {
    grid-template-columns: 1fr;
  }

  .local-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    --local-visible-rows: 8;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    width: 74px;
    transform: none;
    z-index: 20;
  }

  .sidebar-top {
    padding-inline: 10px;
  }

  .sidebar-nav,
  .sidebar-footer {
    padding-inline: 8px;
  }

  .brand {
    justify-content: center;
    gap: 0;
  }

  .brand-text,
  .menu-label {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  .menu-item,
  .utility-item {
    justify-content: center;
    padding: 0;
  }

  body.sidebar-open .sidebar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: min(72vw, 268px);
    transform: translateX(0);
    z-index: 30;
  }

  body.sidebar-open .sidebar-top {
    padding-inline: 16px;
  }

  body.sidebar-open .sidebar-nav,
  body.sidebar-open .sidebar-footer {
    padding-inline: 10px;
  }

  body.sidebar-open .brand {
    justify-content: flex-start;
    gap: 12px;
  }

  body.sidebar-open .brand-text,
  body.sidebar-open .menu-label {
    width: auto;
    opacity: 1;
    overflow: visible;
  }

  body.sidebar-open .menu-item,
  body.sidebar-open .utility-item {
    justify-content: flex-start;
    padding: 0 12px;
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 30, 0.32);
    z-index: 24;
  }

  .mobile-trigger {
    display: inline-grid;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .top-chip span,
  .visit-label,
  .calendar-lunar {
    display: none;
  }

  .topbar-view-search {
    flex-basis: min(46vw, 360px);
    min-width: 200px;
  }

  .topbar-view-search .view-search-meta {
    display: none;
  }

  .local-transfer-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .top-chip {
    min-width: 36px;
    padding: 0 10px;
  }

  .visit-toggle {
    min-height: 36px;
    padding: 0 10px;
    justify-content: center;
  }

  .visit-popover {
    width: min(360px, 92vw);
  }

  .calendar-toggle {
    min-height: 36px;
    padding: 4px 10px;
  }

  .calendar-date {
    display: none;
  }

  .calendar-popover {
    width: min(360px, 92vw);
  }

  .calendar-month-picker {
    grid-template-columns: 1fr;
  }

  .calendar-picker-actions {
    justify-content: flex-end;
  }

  .notice-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(96px, 32%) minmax(0, 1fr);
  }

  .notes-rich-tools {
    gap: 6px;
  }
}

@media (max-width: 760px) {
  .headline p {
    display: none;
  }

  .headline h1 {
    font-size: var(--step-1);
  }

  .topbar-right {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-view-search {
    order: -1;
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .local-transfer-toolbar {
    order: -1;
  }

  .topbar-view-search .view-search-meta {
    display: none;
  }

  .topbar-view-search .view-search-input-wrap {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-tasks-search .view-search-input-wrap {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .topbar-ai-search .view-search-input-wrap {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .visit-value {
    font-size: 0.74rem;
  }

  .calendar-time {
    font-size: 0.76rem;
  }

  .calendar-term-list {
    grid-template-columns: 1fr;
  }

  .notes-rich-tools {
    gap: 6px;
  }

  .stats-grid,
  .recommend-category-grid,
  .recommend-items-grid,
  .bg-options {
    grid-template-columns: 1fr;
  }

  .topbar-view-search .view-search-input-wrap button {
    width: auto;
  }

  .topbar-tasks-search .tasks-search-action {
    width: 34px;
    min-width: 34px;
  }

  .topbar-tasks-search .tasks-search-nav button {
    width: 32px;
    min-width: 32px;
  }

  .tasks-alarm-modal {
    width: min(96vw, 430px);
    max-height: min(88vh, 760px);
    padding: 12px;
  }

  .tasks-alarm-head h3 {
    font-size: 1rem;
  }

  .tasks-alarm-schedule-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tasks-alarm-mode-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tasks-alarm-form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tasks-alarm-form-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tasks-alarm-form-actions button {
    min-height: 36px;
  }

  .tasks-alarm-list {
    max-height: min(46vh, 320px);
  }

  .ai-attachment-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .ai-message {
    width: 100%;
  }

  .ai-attachment-row input[type="file"] {
    max-width: none;
    width: 100%;
  }

  .ai-composer-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .ai-composer-actions button {
    flex: 0 0 auto;
  }

  .notes-auth-session {
    flex-direction: column;
    align-items: flex-start;
  }

  .notes-auth-session-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .tasks-calendar-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .tasks-calendar-head > strong {
    grid-column: 1 / -1;
    order: -1;
  }

  .tasks-calendar-head-actions {
    justify-content: flex-end;
  }

  .tasks-calendar-grid {
    gap: 4px;
  }

  .tasks-calendar-grid.is-week-view {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
  }

  .tasks-calendar-cell {
    min-height: 84px;
    padding: 4px;
  }

  .tasks-calendar-day-button {
    min-height: 34px;
  }

  .tasks-calendar-title {
    display: block;
    font-size: 0.82rem;
  }

  .tasks-calendar-quick-row input,
  .tasks-calendar-quick-row button {
    min-height: 24px;
    font-size: 0.68rem;
  }

  .notes-workspace {
    min-height: auto;
    max-height: none;
  }

  .protected-feature-workspace {
    min-height: 360px;
  }

  .notes-auth-modal {
    max-height: calc(100vh - 12px);
  }

  .notes-auth-placeholder > button {
    width: 92px;
    height: 92px;
    font-size: 1rem;
  }

  .notes-editor-panel {
    min-height: 420px;
  }

  .local-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .protected-data-item-actions {
    width: 100%;
  }

  .local-list {
    grid-template-columns: 1fr;
    --local-visible-rows: 10;
  }

  .bg-image-url-row {
    grid-template-columns: 1fr;
  }

  .bg-image-file-row {
    grid-template-columns: 1fr;
  }

  .bg-image-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-row {
    flex-direction: column;
  }

  .notice-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .notice-head-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .notice-head-filters {
    width: 100%;
  }

  .notice-head-filters input {
    flex: 1 1 auto;
    width: auto;
  }

  .notice-modal {
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
    padding: 12px;
  }

  .notice-doc {
    padding: 12px;
  }

  .search-row button {
    width: 100%;
    height: 44px;
  }

  .hero,
  .stat-card,
  .panel,
  .modal {
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 8px 10px;
  }

  .content {
    padding: 10px;
    gap: 10px;
  }

  .hero {
    padding: 14px;
  }

  .panel,
  .stat-card {
    padding-inline: 12px;
  }

  .modal {
    padding: 14px;
  }

  .tasks-calendar-weekdays li {
    font-size: 0.66rem;
  }

  .tasks-calendar-day-number {
    font-size: 0.82rem;
  }

  .tasks-calendar-count {
    min-width: 18px;
    min-height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
  }
}

/* Light theme visual style customization. Font scheme remains global for consistency. */
body[data-theme="light"] {
  --line-soft: rgba(18, 76, 116, 0.24);
  --line-strong: rgba(18, 76, 116, 0.4);
  --text-main: #08243a;
  --text-subtle: #436784;
  --accent: #00aef4;
  --accent-strong: #07d7b5;
  --accent-soft: rgba(0, 174, 244, 0.18);

  --panel-bg: rgba(244, 250, 255, 0.7);
  --panel-bg-strong: rgba(249, 253, 255, 0.88);
  --sidebar-bg: rgba(233, 246, 255, 0.28);
  --chip-bg: rgba(247, 252, 255, 0.78);

  --shadow-soft: 0 14px 28px rgba(5, 40, 72, 0.12);
  --shadow-panel: 0 18px 38px rgba(5, 40, 72, 0.16);

  background: var(--page-bg, radial-gradient(circle at 18% 10%, #e6f8ff 0, #dbeffd 33%, #d1e4f4 100%));
}

body[data-theme="light"]::before {
  width: 54vmax;
  height: 54vmax;
  top: -23vmax;
  right: -16vmax;
  background: conic-gradient(from 210deg at 42% 36%, rgba(0, 174, 244, 0.28), rgba(7, 215, 181, 0.1), rgba(0, 174, 244, 0));
  filter: blur(10px);
}

body[data-theme="light"]::after {
  width: 100%;
  height: 100%;
  inset: 0;
  border-radius: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(10, 91, 141, 0.06) 0,
      rgba(10, 91, 141, 0.06) 1px,
      transparent 1px,
      transparent 32px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(10, 91, 141, 0.05) 0,
      rgba(10, 91, 141, 0.05) 1px,
      transparent 1px,
      transparent 32px
    );
  opacity: 0.6;
  filter: none;
}

body[data-theme="light"][data-bg="mist"] {
  --page-bg: radial-gradient(circle at 18% 10%, #e6f8ff 0, #dbeffd 33%, #d1e4f4 100%);
}

body[data-theme="light"][data-bg="dawn"] {
  --page-bg: radial-gradient(circle at 18% 10%, #fff5e9 0, #f7e8da 34%, #dee5f2 100%);
}

body[data-theme="light"][data-bg="qinglv"] {
  --page-bg: radial-gradient(circle at 18% 10%, #e8fbf5 0, #d9f2ea 34%, #c7e8df 100%);
}

body[data-theme="light"][data-bg="mihuang"] {
  --page-bg: radial-gradient(circle at 18% 10%, #fff9e8 0, #f6edd1 34%, #eadfbc 100%);
}

body[data-theme="light"][data-bg="hailan"] {
  --page-bg: radial-gradient(circle at 18% 10%, #e7f4ff 0, #d4e9fb 34%, #c1dcf3 100%);
}

body[data-theme="light"][data-bg="huifen"] {
  --page-bg: radial-gradient(circle at 18% 10%, #f8edf3 0, #eedde7 34%, #e3d0de 100%);
}

body[data-theme="light"][data-bg="gradient"] {
  --page-bg: linear-gradient(135deg, #dff6ff 0%, #e8f4f0 30%, #efe8ff 68%, #f9ecdc 100%);
}

body[data-theme="light"][data-bg="flow-gradient"] {
  --page-bg: linear-gradient(130deg, #dff6ff 0%, #d2eef0 26%, #e9ddff 52%, #ffdcdc 76%, #fff0ba 100%);
}

body[data-theme="light"] .sidebar {
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.055) 40%, rgba(255, 255, 255, 0.015)),
    linear-gradient(180deg, rgba(0, 174, 244, 0.03), rgba(7, 215, 181, 0.015)),
    var(--sidebar-bg);
  border-inline-end-color: rgba(5, 148, 212, 0.16);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.36),
    inset -1px 0 0 rgba(4, 150, 210, 0.1),
    12px 0 24px rgba(0, 76, 123, 0.08);
}

body[data-theme="light"] .sidebar::before {
  opacity: 0.32;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.065) 34%, rgba(255, 255, 255, 0.015) 72%, rgba(255, 255, 255, 0.1) 100%);
}

body[data-theme="light"] .sidebar::after {
  background:
    radial-gradient(120% 80% at 0% -8%, rgba(126, 224, 255, 0.13), transparent 58%),
    radial-gradient(90% 70% at 0% 108%, rgba(19, 134, 241, 0.1), transparent 62%);
}

body[data-theme="light"] .sidebar-top,
body[data-theme="light"] .sidebar-footer,
body[data-theme="light"] .topbar,
body[data-theme="light"] .site-footer {
  border-color: var(--line-strong);
}

body[data-theme="light"] .logo-wrap {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 10px 22px rgba(0, 120, 180, 0.28);
}

body[data-theme="light"] .brand-text {
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(0, 174, 244, 0.22);
}

body[data-theme="light"] .menu-item:hover,
body[data-theme="light"] .utility-item:hover {
  background: rgba(0, 174, 244, 0.075);
}

body[data-theme="light"] .menu-item.is-active {
  background: linear-gradient(126deg, rgba(0, 174, 244, 0.12), rgba(7, 215, 181, 0.08));
  color: var(--accent-strong);
  box-shadow:
    inset 0 0 0 1px rgba(0, 174, 244, 0.24),
    0 0 0 1px rgba(0, 174, 244, 0.1);
}

body[data-theme="light"] .topbar {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08)),
    linear-gradient(178deg, rgba(0, 174, 244, 0.08), rgba(7, 215, 181, 0.03)),
    var(--panel-bg);
}

body[data-theme="light"] .visit-query-row input {
  color: #173857;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(18, 76, 116, 0.3);
}

body[data-theme="light"] .visit-query-row input::-webkit-datetime-edit {
  color: #173857;
}

body[data-theme="light"] .icon-btn,
body[data-theme="light"] .top-chip,
body[data-theme="light"] .calendar-toggle,
body[data-theme="light"] .calendar-popover,
body[data-theme="light"] .calendar-nav button,
body[data-theme="light"] .calendar-month-trigger,
body[data-theme="light"] .calendar-month-picker,
body[data-theme="light"] .calendar-month-picker select,
body[data-theme="light"] .calendar-picker-actions button,
body[data-theme="light"] .calendar-day,
body[data-theme="light"] .calendar-summary,
body[data-theme="light"] .visit-toggle,
body[data-theme="light"] .visit-popover,
body[data-theme="light"] .visit-reset-btn,
body[data-theme="light"] .visit-query-row input,
body[data-theme="light"] .visit-query-row button,
body[data-theme="light"] .panel-head button,
body[data-theme="light"] .modal-head button {
  border-color: var(--line-strong);
}

body[data-theme="light"] .headline h1,
body[data-theme="light"] .hero h2,
body[data-theme="light"] .panel-head h3,
body[data-theme="light"] .stat-card h3,
body[data-theme="light"] .modal-head h3 {
  letter-spacing: 0.02em;
}

body[data-theme="light"] .top-chip,
body[data-theme="light"] .calendar-toggle,
body[data-theme="light"] .calendar-nav button,
body[data-theme="light"] .calendar-month-trigger,
body[data-theme="light"] .calendar-picker-actions button,
body[data-theme="light"] .visit-toggle,
body[data-theme="light"] .visit-reset-btn,
body[data-theme="light"] .visit-query-row button,
body[data-theme="light"] .panel-head button {
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.34));
}

body[data-theme="light"] .hero,
body[data-theme="light"] .stat-card,
body[data-theme="light"] .panel,
body[data-theme="light"] .modal {
  border-color: var(--line-strong);
}

body[data-theme="light"] .hero {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.16)),
    linear-gradient(170deg, rgba(0, 174, 244, 0.12), rgba(7, 215, 181, 0.04));
}

body[data-theme="light"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 174, 244, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 174, 244, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.55;
  pointer-events: none;
}

body[data-theme="light"] .hero::after {
  width: 240px;
  height: 240px;
  right: -95px;
  top: -86px;
  background: radial-gradient(circle at 30% 30%, rgba(0, 174, 244, 0.28), rgba(7, 215, 181, 0));
}

body[data-theme="light"] .search-row input {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.56));
}

body[data-theme="light"] .search-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 174, 244, 0.26);
}

body[data-theme="light"] .search-row button {
  background: linear-gradient(132deg, #00a7e8, #05c7d9 52%, #1ae3bc);
}

body[data-theme="light"] .stat-card {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.16)),
    linear-gradient(180deg, rgba(0, 174, 244, 0.1), rgba(7, 215, 181, 0.04));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body[data-theme="light"] .stat-card::after {
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 174, 244, 0.92), rgba(7, 215, 181, 0.92));
}

body[data-theme="light"] .stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 36px rgba(0, 47, 74, 0.2),
    inset 0 0 0 1px rgba(0, 174, 244, 0.22);
}

body[data-theme="light"] .panel {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.16)),
    linear-gradient(180deg, rgba(0, 174, 244, 0.09), rgba(7, 215, 181, 0.03));
}

body[data-theme="light"] .task-list li,
body[data-theme="light"] .recommend-category,
body[data-theme="light"] .recommend-item,
body[data-theme="light"] .bg-option {
  border-color: var(--line-strong);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.18)),
    linear-gradient(170deg, rgba(0, 174, 244, 0.08), rgba(7, 215, 181, 0.02));
}

body[data-theme="light"] .task-list strong,
body[data-theme="light"] .recommend-item strong {
  letter-spacing: 0.01em;
}

body[data-theme="light"] .task-list li {
  position: relative;
  overflow: hidden;
}

body[data-theme="light"] .task-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(0, 174, 244, 0.95), rgba(7, 215, 181, 0.95));
}

body[data-theme="light"] .bg-option.is-selected {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 1px rgba(0, 174, 244, 0.48),
    0 0 18px rgba(0, 174, 244, 0.16);
}

body[data-theme="light"] .modal-backdrop {
  background: rgba(3, 21, 34, 0.58);
}

body[data-theme="light"] :focus-visible {
  outline-color: var(--accent);
}

@media (max-width: 980px) {
  body[data-theme="light"].sidebar-open::after {
    background: rgba(2, 16, 26, 0.44);
  }
}

@media (max-width: 760px) {
  body[data-theme="light"] .hero::before {
    opacity: 0.4;
    background-size: 24px 24px;
  }

  body[data-theme="light"] .top-chip,
  body[data-theme="light"] .panel-head button {
    font-size: 0.74rem;
  }
}

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