/* ============================================================
   Luopu Start Page CSS v3.1.0
   基于 Lframe.css v3.1.0 的起始页定制版
   原生 CSS · 零依赖 · 明暗主题 · 响应式 · 可访问性增强

   说明：
   1. 保留起始页既有类名：.input-box、.navi-items、.navi-icon、
      .navi-background、.the-window、.the-drawer 等。
   2. 默认保持原起始页的 Lframe 简洁视觉，不启用液态玻璃。
   3. 建议先引入 Lframe.css，再引入本文件；本文件也包含必要的
      主题变量兜底，单独引入时仍可工作。
   ============================================================ */

/* ==================== 1. Lframe 3.1.0 Token 兜底 ==================== */
:root {
  --primary: #1565c0;
  --primary-hover: #0d47a1;
  --primary-light: #80b3e5;
  --primary-rgb: 21, 101, 192;

  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  --info: #2196f3;
  --success-rgb: 76, 175, 80;
  --warning-rgb: 255, 152, 0;
  --error-rgb: 244, 67, 54;
  --info-rgb: 33, 150, 243;

  --text: #222;
  --text-light: #666;
  --text-faint: #888;
  --bg: #cfdff5;
  --surface: #fff;
  --surface-muted: #f5f5f5;
  --surface-hover: #fafafa;
  --border: #ddd;
  --border-strong: #c5c5c5;

  --radius: 4px;
  --radius-sm: 3px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;

  --shadow: 0 2px 4px rgba(0, 0, 0, .1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .15);
  --ease: cubic-bezier(.25, .1, .25, 1);
  --duration-fast: .16s;
  --duration: .25s;

  --z-header: 900;
  --z-selector: 950;
  --z-drawer: 1000;
  --z-window: 1100;
  --z-alert: 1300;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --alert-bg: #fff;
  --alert-border: #e0e0e0;
  --alert-title: #1a1a1a;
  --alert-content: #333;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e0e0e0;
    --text-light: #aaa;
    --text-faint: #8d99a6;
    --bg: #1a2a3d;
    --surface: #1e2d40;
    --surface-muted: #24364b;
    --surface-hover: #28405a;
    --border: #334455;
    --border-strong: #496078;
    --primary: #42a5f5;
    --primary-hover: #90caf9;
    --primary-light: #90caf9;
    --shadow: 0 2px 6px rgba(0, 0, 0, .3);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, .4);
    --alert-bg: #1e2d40;
    --alert-border: #334455;
    --alert-title: #e0e0e0;
    --alert-content: #aaa;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --text: #e0e0e0;
  --text-light: #aaa;
  --text-faint: #8d99a6;
  --bg: #1a2a3d;
  --surface: #1e2d40;
  --surface-muted: #24364b;
  --surface-hover: #28405a;
  --border: #334455;
  --border-strong: #496078;
  --primary: #42a5f5;
  --primary-hover: #90caf9;
  --primary-light: #90caf9;
  --shadow: 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, .4);
  --alert-bg: #1e2d40;
  --alert-border: #334455;
  --alert-title: #e0e0e0;
  --alert-content: #aaa;
  color-scheme: dark;
}

:root[data-theme="light"] { color-scheme: light; }

/* ==================== 2. 基础规则 ==================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { -webkit-tap-highlight-color: transparent; }

body a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

body a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

::selection {
  background: rgba(var(--primary-rgb), .22);
  color: var(--text);
}

/* 图标字体由页面自行引入；本文件不强制加载外部字体 */
.iconfont,
.material-icons { font: inherit; }

.material-icons {
  font-family: "Material Icons", sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* ==================== 3. 排版与文章 ==================== */
h3 {
  margin: var(--sp-4) 0 var(--sp-2);
  font-size: 1.5rem;
  font-weight: 500;
}

article h3 { margin-top: 2em; }
article h3:first-child { margin-top: 0; }

article img {
  border-radius: var(--radius-lg);
}

/* ==================== 4. 通用按钮 ==================== */
.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 var(--sp-4);
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition:
    background var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    transform var(--duration-fast) var(--ease);
}

.btn:hover,
button:hover { background: var(--primary-hover); }

.btn:active,
button:active { transform: translateY(1px); }

.btn:disabled,
button:disabled,
.btn[aria-disabled="true"],
button[aria-disabled="true"] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.btn:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ==================== 5. 固定页眉 ==================== */
header {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-header);
  display: flex;
  justify-content: flex-end;
  padding: var(--sp-4) 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

header .action-btn {
  min-height: 36px;
  padding: 0 var(--sp-4);
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text);
  border: 0;
  cursor: pointer;
}

header .action-btn:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

header .action-btn .material-icons,
header .action-btn .fa {
  font-size: 1.5em;
  transition: transform var(--duration) var(--ease);
}

header .action-btn:hover .material-icons,
header .action-btn:hover .fa { transform: scale(1.1); }

/* ==================== 6. 主内容 ==================== */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 960px;
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  padding: 80px var(--sp-4) var(--sp-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ==================== 7. 起始页搜索框 ==================== */
.input-box {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 0 auto 80px;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  transition: box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.input-box:hover,
.input-box:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.input-box input {
  flex: 1;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  background: transparent;
  color: var(--text);
  border: 0;
  outline: 0;
  box-shadow: none;
  font-size: 1rem;
}

.input-box input:focus,
.input-box input:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.input-box input::placeholder { color: var(--text-light); opacity: 1; }

.search-select {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  cursor: pointer;
}

.search-select .material-icons,
.search-select .iconfont {
  pointer-events: none;
  color: var(--text-light);
  font-size: 1.5em;
}

.search-selector {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-selector);
  max-height: min(60vh, 360px);
  margin-top: var(--sp-2);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: scaleY(.96);
  transform-origin: top;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease), visibility var(--duration) var(--ease);
}

.search-selector.active {
  opacity: 1;
  visibility: visible;
  transform: scaleY(1);
}

.search-selector .selector-item {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.search-selector .selector-item:hover,
.search-selector .selector-item:focus-visible {
  background: var(--primary);
  color: #fff;
}

/* ==================== 8. 导航网格 ==================== */
.navi-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5em, 1fr));
  gap: 2em;
  text-align: center;
}

.navi-items .item {
  display: block;
  color: inherit;
  text-decoration: none;
}

.navi-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
  color: var(--primary);
  border-radius: 2em;
  box-shadow: var(--shadow);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.navi-icon:hover,
.navi-items .item:focus-visible .navi-icon {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.navi-icon .material-icons,
.navi-icon i { color: var(--text); }

.navi-icon i,
.navi-icon .material-icons {
  transition: transform var(--duration) var(--ease);
}

.navi-icon:hover i,
.navi-icon:hover .material-icons,
.navi-items .item:focus-visible .navi-icon i,
.navi-items .item:focus-visible .navi-icon .material-icons {
  transform: scale(1.1);
}

.navi-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.navi-title {
  margin-top: var(--sp-3);
  color: var(--text);
  font-size: .875rem;
}

/* ==================== 9. 背景层 ==================== */
.navi-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--ease);
}

.navi-background.active { opacity: .6; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .navi-background.type-1 {
    mix-blend-mode: multiply;
  }
}

:root[data-theme="dark"] .navi-background.type-1 { mix-blend-mode: multiply; }

/* ==================== 10. 页尾 ==================== */
footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: var(--sp-4) 0;
  background: var(--surface);
  color: var(--text-light);
  box-shadow: var(--shadow);
  text-align: center;
  font-size: .875rem;
}

footer a { color: var(--primary); }

/* ==================== 11. 定制窗口 / 弹窗 ==================== */
window,
.window {
  position: fixed;
  inset: 0;
  z-index: var(--z-window);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgba(0, 0, 0, .5);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

window.active,
.window.active {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

@supports (backdrop-filter: blur(1px)) {
  window,
  .window { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
}

.the-window {
  display: none;
  width: min(90vw, 40em);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalShow var(--duration) var(--ease);
}

.the-window.active { display: block; }

.the-window .window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) 0;
  margin-bottom: var(--sp-4);
}

.the-window .window-title {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 500;
}

.the-window .window-head button,
.the-drawer .drawer-head button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-light);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.the-window .window-head button:hover,
.the-drawer .drawer-head button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.the-window .window-body {
  max-height: calc(100vh - 120px);
  padding: var(--sp-5);
  overflow: auto;
}

@keyframes modalShow {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ==================== 12. 侧边抽屉 ==================== */
.the-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: var(--z-drawer);
  width: 100%;
  max-width: 25em;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--duration) var(--ease);
}

.the-drawer.active { transform: translateX(0); }

.the-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.the-drawer .drawer-body {
  flex: 1;
  overflow: auto;
  padding: var(--sp-4);
}

.the-drawer.sites .sites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7em, 1fr));
  gap: var(--sp-2);
  margin-bottom: 3em;
}

.the-drawer.sites .sites span {
  padding: var(--sp-3);
  background: var(--surface-muted);
  color: var(--text);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}

.the-drawer.sites .sites span:hover,
.the-drawer.sites .sites span:focus-visible {
  background: var(--surface-hover);
  outline: 2px solid var(--primary-light);
  outline-offset: 1px;
}

.the-drawer.sites .sites span:active { transform: scale(.98); }
.the-drawer.sites .sites span.active { background: var(--primary); color: #fff; }
.the-drawer.sites .add-sites { opacity: .6; font-size: .875rem; text-align: center; }

/* ==================== 13. 表单与 alert ==================== */
textarea,
select,
.input {
  width: 100%;
  min-height: 40px;
  margin: var(--sp-2) 0;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.input { display: block; }

textarea { resize: vertical; min-height: 80px; }

input:focus,
textarea:focus,
select:focus,
.input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .2);
}

input:disabled,
textarea:disabled,
select:disabled,
.input:disabled {
  background: var(--surface-muted);
  cursor: not-allowed;
  opacity: .7;
}

input[readonly],
textarea[readonly] { background: var(--surface-muted); }

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"],
.input.is-invalid { border-color: var(--error); }

#customAlertBox {
  position: fixed;
  inset: 0;
  z-index: var(--z-alert);
  width: min(88vw, 400px);
  max-height: 82vh;
  height: fit-content;
  margin: auto;
  padding: var(--sp-5);
  overflow-y: auto;
  display: none;
  background: var(--alert-bg);
  color: var(--text);
  border: 1px solid var(--alert-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

#customAlertBox h2 {
  margin: 0 0 var(--sp-3);
  color: var(--alert-title);
  font-size: 1.2rem;
  font-weight: 500;
}

#customAlertContent {
  margin: var(--sp-3) 0 var(--sp-4);
  color: var(--alert-content);
  line-height: 1.6;
  font-size: 1rem;
  word-break: break-word;
}

/* ==================== 14. 滚动条与字段集 ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset legend { margin-bottom: var(--sp-4); padding: 0; color: var(--text); font-size: 1.1em; font-weight: 500; }
fieldset > *:not(legend) { margin-top: var(--sp-2); margin-bottom: var(--sp-2); }

/* ==================== 15. 辅助类与图片尺寸 ==================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-16 { margin-top: var(--sp-4); }
.mb-16 { margin-bottom: var(--sp-4); }

.hiluolicn-img {
  width: 192px;
  height: 48px;
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
}

.start {
  width: 112px;
  height: 60px;
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
}

/* ==================== 16. 响应式 ==================== */
@media (max-width: 768px) {
  .navi-items {
    grid-template-columns: repeat(auto-fill, minmax(4em, 1fr));
    gap: 2em 1.5em;
  }

  .navi-icon {
    width: 3.75rem;
    height: 3.75rem;
    font-size: 1.3em;
  }

  main { padding-left: var(--sp-3); padding-right: var(--sp-3); }
}

@media (max-width: 600px) {
  footer { position: relative; }
  .input-box { margin-bottom: var(--sp-6); }
}

@media (max-width: 480px) {
  main {
    min-height: calc(100vh - 96px);
    padding-top: 72px;
  }

  .the-window {
    width: 95%;
    max-height: calc(100vh - 32px);
  }

  .the-window .window-head,
  .the-window .window-body { padding-left: var(--sp-4); padding-right: var(--sp-4); }

  #customAlertBox { width: 90%; padding: var(--sp-4); }
  #customAlertBox h2 { font-size: 1.2em; }
  #customAlertContent { font-size: .95em; }
}

@media (hover: none) {
  .navi-icon:hover,
  .navi-icon:hover i,
  .navi-icon:hover .material-icons,
  header .action-btn:hover .material-icons,
  header .action-btn:hover .fa {
    transform: none;
  }
}

/* ==================== 17. 减少动态效果、强制颜色和打印 ==================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  header,
  footer,
  .input-box,
  .search-selector,
  .navi-icon,
  .the-window,
  .the-drawer,
  #customAlertBox,
  .btn,
  button,
  textarea,
  select,
  .input {
    background: Canvas;
    color: CanvasText;
    border: 1px solid CanvasText;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .navi-background { display: none; }
}

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  header,
  .navi-background,
  .the-drawer,
  window,
  .window,
  #customAlertBox { display: none !important; }

  .navi-icon,
  .input-box,
  .the-window,
  footer { border: 1px solid #999; }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .85em;
  }
}

/* ============================================================
   使用说明

   推荐引入顺序：
   <link rel="stylesheet" href="https://hiluoli.cn/Lframe.css">
   <link rel="stylesheet" href="/static/main.css">

   强制主题：
   <html data-theme="light">
   <html data-theme="dark">

   加载按钮建议：
   <button class="btn btn-loading" aria-busy="true" disabled>
     提交中
   </button>
   ============================================================ */

/* 兼容旧页面的加载按钮状态 */
.btn-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: start-page-spin .7s linear infinite;
}

@keyframes start-page-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-loading::after { animation: none; }
}

/* =====================================================================
   22. Lframe 模态框（.modal）基础样式 —— 结构见 LframeNG.html 文档
   【待替换】以下为过渡期基础样式，作者将另行编写专用 CSS 覆盖
   ===================================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .5);
}
.modal.active { display: flex; }

.modal-content {
  width: min(90vw, 420px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface, #fff);
  color: var(--text, #222);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
  animation: lf-modal-in .2s ease;
}

#modal-updated .modal-content,
#modal-about .modal-content { width: min(94vw, 600px); }
#modal-setting .modal-content { width: min(94vw, 480px); }
#modal-manage .modal-content { width: min(94vw, 760px); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-title { font-size: 1.25rem; font-weight: 500; }

.close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light, #666);
}
.close:hover { color: var(--text, #222); }
.close:focus-visible {
  outline: 2px solid var(--primary-light, #80b3e5);
  outline-offset: 2px;
}

@keyframes lf-modal-in {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

/* 管理导航项弹窗内的预设/自定义列表（过渡基础样式） */
#modal-manage .sites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7em, 1fr));
  gap: 8px;
  margin: 12px 0 28px;
}
#modal-manage .sites span {
  padding: 10px 8px;
  text-align: center;
  background: var(--surface-muted, rgba(0, 0, 0, .05));
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
#modal-manage .sites span:hover,
#modal-manage .sites span:focus-visible {
  background: var(--surface-hover, rgba(0, 0, 0, .1));
  outline: 2px solid var(--primary-light, #80b3e5);
  outline-offset: 1px;
}
#modal-manage .sites span:active { transform: scale(.97); }
#modal-manage .sites span.active { background: var(--primary, #1565c0); color: #fff; }

#modal-manage .current-custom .btn { width: 100%; justify-content: space-between; margin: 8px 0; }
#modal-manage .custom-add { margin-top: 20px; }
#modal-manage .input-group { display: flex; gap: 8px; flex-wrap: wrap; }
#modal-manage .input-group .input { flex: 1 1 160px; }
#modal-manage blockquote { margin: 14px 0 8px; }

@media (prefers-reduced-motion: reduce) {
  .modal-content { animation: none; }
}

/* =====================================================================
   23. LStart 云备份区块（设置弹窗内）
   ===================================================================== */
[hidden] { display: none !important; }
.lstart-sync-status {
  color: var(--text-light, #666);
  font-size: .9rem;
  line-height: 1.7;
}

/* =====================================================================
   24. LStart 轻提示（.notification 挂载于 #lstart-notify-area）
   ===================================================================== */
#lstart-notify-area {
  position: fixed;
  /* 放在固定页眉(约68px)下方，避免与右上角操作按钮重叠 */
  top: 80px;
  right: 12px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(92vw, 360px);
  pointer-events: none;
}
#lstart-notify-area .notification {
  display: block;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: var(--radius, 8px);
  /* 半透明毛玻璃背景 */
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  color: var(--text, #222);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.6;
  word-break: break-word;
  pointer-events: auto;
  animation: lf-notify-in .4s cubic-bezier(.34, 1.56, .64, 1);
}
#lstart-notify-area .notification.success {
  background: rgba(var(--success-rgb, 76, 175, 80), .28);
  border-color: var(--success, #4caf50);
  color: var(--success, #2e7d32);
}
#lstart-notify-area .notification.error {
  background: rgba(var(--error-rgb, 244, 67, 54), .28);
  border-color: var(--error, #f44336);
  color: var(--error, #c62828);
}
#lstart-notify-area .notification.warning {
  background: rgba(var(--warning-rgb, 255, 152, 0), .3);
  border-color: var(--warning, #ff9800);
  color: var(--warning, #b26a00);
}
#lstart-notify-area .notification.info {
  background: rgba(var(--info-rgb, 33, 150, 243), .28);
  border-color: var(--info, #2196f3);
  color: var(--info, #1565c0);
}
#lstart-notify-area .notification.out {
  opacity: 0;
  transform: translateY(-10px) scale(.96);
  transition: opacity .3s cubic-bezier(.4, 0, 1, 1), transform .3s cubic-bezier(.4, 0, 1, 1);
}
@keyframes lf-notify-in {
  0%   { opacity: 0; transform: translateY(-16px) scale(.92); }
  60%  { opacity: 1; transform: translateY(4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #lstart-notify-area .notification { animation: none; }
  #lstart-notify-area .notification.out { transition: none; }
}

/* =====================================================================
   25. 导航卡片拖拽反馈（配合容器级委托排序）
   ===================================================================== */
.navi-items .item {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: element;
  cursor: grab;
  transition: transform var(--duration, .25s) ease, opacity var(--duration, .25s) ease;
}
.navi-items .item:active { cursor: grabbing; }
.navi-items .item.dragging {
  opacity: .45;
  transform: scale(.94);
  pointer-events: none;
}
.navi-items .item .navi-icon,
.navi-items .item img {
  -webkit-user-drag: none;
}

/* =====================================================================
   26. AI 门户 · 通用小组件（icon-btn / btn 变体 / ls-input / Markdown / Toast）
   —— start.php + lstart-core.js + start-search.js + start-dashboard.js
      + start-chat.js 共用的最小样式集。放在新分节最前面，后面各分节直接复用。
   ===================================================================== */
:root {
  --ls-glass: rgba(255, 255, 255, .74);
  --ls-glass-strong: rgba(255, 255, 255, .92);
  --ls-tint: rgba(var(--primary-rgb), .08);
  --ls-tint-strong: rgba(var(--primary-rgb), .18);
  --ls-hairline: rgba(0, 0, 0, .07);
  --ls-danger-tint: rgba(var(--error-rgb), .12);
  --ls-success-tint: rgba(var(--success-rgb), .14);
  --ls-warn-tint: rgba(var(--warning-rgb), .16);

  --z-ls-panel: 1040;
  --z-ls-dock: 1050;
  --z-ls-island: 1090;
  --z-ls-mask: 1600;
  --z-ls-drawer: 1610;
  --z-ls-toast: 1700;
  --z-ls-alert: 1800;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ls-glass: rgba(30, 45, 64, .78);
    --ls-glass-strong: rgba(30, 45, 64, .93);
    --ls-tint: rgba(var(--primary-rgb), .14);
    --ls-tint-strong: rgba(var(--primary-rgb), .26);
    --ls-hairline: rgba(255, 255, 255, .08);
  }
}

:root[data-theme="dark"] {
  --ls-glass: rgba(30, 45, 64, .78);
  --ls-glass-strong: rgba(30, 45, 64, .93);
  --ls-tint: rgba(var(--primary-rgb), .14);
  --ls-tint-strong: rgba(var(--primary-rgb), .26);
  --ls-hairline: rgba(255, 255, 255, .08);
}

/* 通知区与警示框要压在新增加的面板 / 抽屉之上 */
#lstart-notify-area { z-index: var(--z-ls-toast); }
#customAlertBox { z-index: var(--z-ls-alert); }

/* --- 按钮变体 --- */
.btn.small,
button.small {
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  font-size: .85rem;
  border-radius: var(--radius);
}

.btn.small i.material-icons,
.btn i.material-icons {
  font-size: 1.05em;
  line-height: 1;
}

.btn.primary,
button.primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.btn.transparent,
button.transparent {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.btn.transparent:hover,
button.transparent:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--border-strong);
}

/* --- 纯图标按钮（.icon-btn 可以是 <button> 也可以是 <a>） --- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  background: transparent;
  color: var(--text-light);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease);
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--ls-hairline);
}

.icon-btn:active { transform: none; }

.icon-btn i.material-icons,
.icon-btn .material-icons {
  font-size: 1.15rem;
  line-height: 1;
}

.icon-btn:disabled,
.icon-btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  background: transparent;
}

/* --- 通用小字号辅助类 --- */
.small { font-size: .85rem; line-height: 1.6; }

/* --- 文本输入（起始页新模块统一样式；老页面继续用 .input） --- */
input.ls-input,
textarea.ls-input,
select.ls-input,
.ls-input {
  width: 100%;
  min-height: 36px;
  margin: 6px 0;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .92rem;
  line-height: 1.5;
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}

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

.ls-input:focus,
.ls-input:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .18);
}

.ls-input::placeholder { color: var(--text-faint); opacity: 1; }

/* --- 轻量 Markdown 输出（AI 摘要 / 对话气泡 / 草稿纸 / 直达卡片共用） --- */
.ls-md-pre,
.ai-summary-body pre,
.msg-text pre,
.scratch-md pre {
  margin: .6em 0;
  padding: 10px 12px;
  overflow-x: auto;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono, monospace);
  font-size: .85rem;
  line-height: 1.6;
}

.ls-md-code,
.ai-summary-body code,
.msg-text code,
.scratch-md code {
  padding: 1px 5px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm, 3px);
  font-family: var(--font-mono, monospace);
  font-size: .88em;
}

.ls-md-table-wrap,
.ai-summary-body .ls-md-table-wrap,
.msg-text .ls-md-table-wrap,
.scratch-md .ls-md-table-wrap {
  max-width: 100%;
  margin: .6em 0;
  overflow-x: auto;
}

.ls-md-table,
.ai-summary-body .ls-md-table,
.msg-text .ls-md-table,
.scratch-md .ls-md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.ls-md-table th,
.ls-md-table td {
  padding: 6px 8px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.ls-md-table thead th {
  background: var(--ls-tint);
  font-weight: 600;
  white-space: nowrap;
}

/* --- Toast（core.notify 生成的 .ls-toast） --- */
.ls-toast-wrap {
  position: fixed;
  top: 72px;
  right: 12px;
  z-index: var(--z-ls-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(92vw, 340px);
  pointer-events: none;
}

.ls-toast {
  max-width: 100%;
  padding: 10px 14px;
  background: var(--ls-glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  font-size: .88rem;
  line-height: 1.6;
  word-break: break-word;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  pointer-events: auto;
}

.ls-toast.show { opacity: 1; transform: translateY(0); }
.ls-toast.ok { border-left-color: var(--success); }
.ls-toast.warn { border-left-color: var(--warning); }
.ls-toast.error { border-left-color: var(--error); }

/* =====================================================================
   27. AI 门户 · 悬浮工具条与每日简报
   ===================================================================== */
#toolDock,
.tool-dock {
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
  z-index: var(--z-ls-dock);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--ls-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}

#toolDock .action-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--text-light);
}

#toolDock .action-btn:hover {
  background: var(--ls-tint-strong);
  color: var(--primary);
}

#toolDock .action-btn .material-icons { font-size: 1.35em; }

/* --- 每日简报横幅 --- */
.brief-bar {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  width: 100%;
  max-width: 960px;
  margin: 60px auto 0;
  padding: 14px 16px;
  background: var(--ls-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.brief-bar.folded { padding-bottom: 10px; }

.brief-main { flex: 1 1 auto; min-width: 0; }

.brief-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.brief-date {
  font-family: var(--font-mono, monospace);
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--text-faint);
}

.brief-greeting {
  color: var(--primary);
  font-size: .98rem;
  font-weight: 600;
}

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

.brief-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--text);
}

.brief-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: .55em;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--ls-tint);
}

.brief-loading {
  color: var(--text-faint);
  font-size: .88rem;
  animation: ls-pulse 1.4s ease-in-out infinite;
}

.brief-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

/* =====================================================================
   28. AI 门户 · 智能搜索（联想 / 结果面板 / AI 摘要 / 直达卡片）
   ===================================================================== */
.navi-search { position: relative; }

/* 搜索框下方的浮层：联想词与结果面板共用定位 */
.search-suggest,
.search-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  width: min(100%, 620px);
  margin: 0 auto;
  z-index: var(--z-ls-panel);
  background: var(--ls-glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
  animation: ls-pop-in .18s var(--ease);
}

.search-panel { width: min(100%, 760px); }

@keyframes ls-pop-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 联想词 --- */
.search-suggest {
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: min(36vh, 300px);
  overflow-y: auto;
}

.suggest-item {
  display: block;
  padding: 9px 12px;
  color: var(--text);
  border-radius: var(--radius);
  font-size: .92rem;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.suggest-item:hover,
.suggest-item.active {
  background: var(--primary);
  color: #fff;
}

/* --- 结果面板 --- */
.search-panel {
  display: flex;
  flex-direction: column;
  max-height: min(52vh, 520px);
  overflow: hidden;
}

.search-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid var(--ls-hairline);
}

.search-panel-query {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
}

.search-panel-state {
  flex: 0 0 auto;
  font-size: .8rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.search-panel-state.ok { color: var(--success); }
.search-panel-state.warn { color: var(--warning); }
.search-panel-state:empty { display: none; }

.search-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- AI 摘要卡片 --- */
.ai-summary-card {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--ls-hairline);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
}

.ai-summary-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: .85rem;
  font-weight: 600;
}

.ai-summary-head i.material-icons { font-size: 1.1em; }
.ai-summary-head .ai-summary-stop { margin-left: auto; }

.ai-summary-card.streaming .ai-summary-head i.material-icons {
  animation: ls-pulse 1.1s ease-in-out infinite;
}

.ai-summary-body {
  color: var(--text);
  font-size: .92rem;
  line-height: 1.75;
  word-break: break-word;
}

.ai-summary-body p { margin: .45em 0; }
.ai-summary-body ul,
.ai-summary-body ol { margin: .45em 0; padding-left: 1.3em; }
.ai-summary-body li { margin: .2em 0; }
.ai-summary-body h3,
.ai-summary-body h4,
.ai-summary-body h5,
.ai-summary-body h6 { margin: .7em 0 .35em; font-size: 1em; font-weight: 600; }
.ai-summary-body a { color: var(--primary); }
.ai-summary-body blockquote {
  margin: .6em 0;
  padding-left: .8em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-light);
}
.ai-summary-body > :first-child { margin-top: 0; }
.ai-summary-body > :last-child { margin-bottom: 0; }

.ai-summary-loading,
.ai-summary-muted {
  margin: 0;
  color: var(--text-faint);
  font-size: .88rem;
  line-height: 1.7;
}

.ai-summary-loading { animation: ls-pulse 1.4s ease-in-out infinite; }

.ai-summary-foot:empty { display: none; }

.ai-summary-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--ls-hairline);
  font-size: .8rem;
}

.ai-summary-sources .src-label {
  padding: 1px 6px;
  background: var(--ls-tint);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.ai-summary-sources a {
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.ai-summary-sources a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.src-ref {
  display: inline-block;
  padding: 0 3px;
  color: var(--primary);
  font-size: .75em;
  font-weight: 600;
  vertical-align: super;
  text-decoration: none;
}

/* --- 引擎官方结果 --- */
.engine-results { display: grid; gap: 6px; }

.engine-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}

.engine-result:hover {
  background: var(--surface-hover);
  border-color: var(--ls-hairline);
  transform: translateX(2px);
}

.er-index {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ls-tint);
  color: var(--primary);
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
}

.er-main { flex: 1 1 auto; min-width: 0; display: block; }

.er-title {
  display: block;
  color: var(--text);
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.5;
}

.engine-result:hover .er-title { color: var(--primary); }

.er-host {
  display: block;
  margin-top: 1px;
  color: var(--success);
  font-size: .76rem;
  word-break: break-all;
}

.er-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-light);
  font-size: .82rem;
  line-height: 1.6;
}

/* --- 意图直达卡片 --- */
.direct-card {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
}

.direct-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
}

.direct-head i.material-icons { font-size: 1.15em; color: var(--primary); }
.direct-mount { margin-top: 6px; }

.direct-muted {
  margin: 6px 0;
  color: var(--text-light);
  font-size: .88rem;
  line-height: 1.7;
}

.direct-card .card-loading,
.direct-card .card-muted { font-size: .85rem; }

.convert-line {
  margin: 6px 0;
  color: var(--text);
  font-size: .95rem;
  line-height: 1.6;
  word-break: break-word;
}

.convert-out {
  margin: 4px 0;
  color: var(--primary);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.convert-rate {
  margin: 6px 0;
  color: var(--text-light);
  font-size: .84rem;
  line-height: 1.6;
}

/* --- 邮件草稿 --- */
.mail-field { margin: 8px 0; }

.mail-label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-faint);
  font-size: .76rem;
  letter-spacing: .04em;
}

.mail-body { min-height: 120px; font-family: inherit; }

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* =====================================================================
   29. AI 门户 · 仪表盘卡片（简报下方可折叠区域）
   ===================================================================== */
.dash-zone {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--sp-4) var(--sp-5);
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}

.dash-toggle {
  width: 100%;
  min-height: 40px;
  gap: 8px;
  justify-content: center;
  background: var(--ls-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  color: var(--text-light);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius-pill);
  font-size: .88rem;
  font-weight: 500;
}

.dash-toggle:hover {
  background: var(--ls-tint-strong);
  color: var(--primary);
}

.dash-toggle .material-icons { font-size: 1.15rem; }
.dash-caret { transition: transform var(--duration) var(--ease); }
.dash-toggle[aria-expanded="true"] .dash-caret { transform: rotate(180deg); }

/* --- 卡片骨架 --- */
.dash-card {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.dash-card:hover { box-shadow: var(--shadow-lg); }
.dash-card.folded { padding-bottom: 12px; }
.dash-card.folded .card-body { display: none; }

.card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}

.card-head > i.material-icons {
  flex: 0 0 auto;
  font-size: 1.2rem;
  color: var(--primary);
}

.card-head h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.card-sub {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-faint);
  font-size: .76rem;
}

.card-tools {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.card-body { margin-top: 10px; }

.card-foot {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--ls-hairline);
  color: var(--text-faint);
  font-size: .76rem;
  line-height: 1.6;
}

.card-loading,
.card-muted,
.card-error {
  margin: 6px 0;
  font-size: .86rem;
  line-height: 1.7;
}

.card-loading { color: var(--text-faint); animation: ls-pulse 1.4s ease-in-out infinite; }
.card-muted { color: var(--text-light); }
.card-error { color: var(--error); }
.card-muted a { color: var(--primary); }

.card-inline-btn { margin-top: 8px; }

@keyframes ls-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* --- 天气 --- */
.wx-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.wx-glyph {
  font-size: 1.9rem;
  line-height: 1;
}

.wx-temp {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--text);
}

.wx-temp b { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.wx-temp span { font-size: .9rem; color: var(--text-light); }

.wx-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--text-light);
  font-size: .82rem;
  line-height: 1.6;
}

.wx-days {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.wx-day {
  flex: 1 0 auto;
  min-width: 62px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 6px;
  background: var(--ls-tint);
  border-radius: var(--radius);
  text-align: center;
}

.wx-day-label { color: var(--text-faint); font-size: .72rem; }
.wx-day-glyph { font-size: 1.05rem; line-height: 1.2; }
.wx-day-text { color: var(--text-light); font-size: .74rem; }
.wx-day-temp { color: var(--text); font-size: .76rem; font-weight: 600; }

.wx-extra {
  margin: 8px 0 0;
  color: var(--text-faint);
  font-size: .78rem;
}

.wx-indices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.wx-chip {
  padding: 3px 8px;
  background: var(--surface-muted);
  color: var(--text-light);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius-pill);
  font-size: .74rem;
  white-space: nowrap;
}

/* --- 城市选择 --- */
.city-picker {
  margin-top: 10px;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
}

.city-picker-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.city-picker-row .ls-input { margin: 0; flex: 1 1 auto; min-width: 0; }
.city-picker-row .city-go { flex: 0 0 auto; }

.city-results {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.city-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .84rem;
  font-weight: 400;
}

.city-item:hover { background: var(--ls-tint); color: var(--primary); border-color: var(--primary); }
.city-item span { color: var(--text-faint); font-size: .74rem; font-family: var(--font-mono, monospace); }

/* --- 行情 --- */
.quote-list { display: grid; gap: 4px; }

.quote-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius);
  transition: background var(--duration-fast) var(--ease);
}

.quote-row:hover { background: var(--surface-hover); }

.quote-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: .86rem;
}

.quote-price {
  flex: 0 0 auto;
  font-family: var(--font-mono, monospace);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}

.quote-chg {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  font-family: var(--font-mono, monospace);
  font-size: .78rem;
  color: var(--text-faint);
}

.quote-row.up .quote-price,
.quote-row.up .quote-chg { color: var(--success); }

.quote-row.down .quote-price,
.quote-row.down .quote-chg { color: var(--error); }

.quote-row.alert { animation: ls-quote-alert 1.8s ease-in-out infinite; }
.quote-row.up.alert { background: var(--ls-success-tint); }
.quote-row.down.alert { background: var(--ls-danger-tint); }

@keyframes ls-quote-alert {
  0%, 100% { box-shadow: inset 3px 0 0 transparent; }
  50% { box-shadow: inset 3px 0 0 currentColor; }
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

/* --- 待办 --- */
.todo-add {
  display: flex;
  align-items: center;
  gap: 6px;
}

.todo-add .ls-input { margin: 0; flex: 1 1 auto; min-width: 0; }
.todo-add .btn { flex: 0 0 auto; }

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

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 6px 6px 4px;
  border-radius: var(--radius);
  transition: background var(--duration-fast) var(--ease), opacity var(--duration) var(--ease);
}

.todo-item:hover { background: var(--surface-hover); }
.todo-item.busy { opacity: .55; }

.todo-item label {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.todo-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.todo-text {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: .88rem;
  line-height: 1.65;
  word-break: break-word;
}

.todo-item.done .todo-text {
  color: var(--text-faint);
  text-decoration: line-through;
}

.todo-actions {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 0;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.todo-item:hover .todo-actions,
.todo-item:focus-within .todo-actions { opacity: 1; }

.todo-actions .icon-btn { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }

/* --- RSS --- */
.rss-block {
  padding: 10px;
  margin-bottom: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
}

.rss-block.busy { opacity: .6; }
.rss-block:last-child { margin-bottom: 0; }

.rss-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rss-head b {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .86rem;
  font-weight: 600;
}

.rss-actions { flex: 0 0 auto; display: inline-flex; gap: 0; }
.rss-actions .icon-btn { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }

.rss-items {
  margin: 8px 0 0;
  padding-left: 1.1em;
  list-style: disc;
}

.rss-items li {
  margin: 3px 0;
  color: var(--text);
  font-size: .84rem;
  line-height: 1.6;
}

.rss-items li a { color: var(--text); text-decoration: none; }
.rss-items li a:hover { color: var(--primary); text-decoration: underline; }

.rss-date {
  display: block;
  color: var(--text-faint);
  font-size: .72rem;
}

.rss-summary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--ls-hairline);
  font-size: .84rem;
  line-height: 1.7;
  color: var(--text-light);
}

.rss-summary .rss-items li { font-size: .82rem; }

/* --- 场景 --- */
.scene {
  padding: 10px;
  margin-bottom: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
}

.scene:last-of-type { margin-bottom: 0; }

.scene-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scene-head b { flex: 1 1 auto; min-width: 0; font-size: .88rem; font-weight: 600; }

.scene-actions { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; }
.scene-actions .icon-btn { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }

.scene-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.scene-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: .8rem;
  transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}

.scene-link:hover { border-color: var(--primary); background: var(--ls-tint); }
.scene-link a { color: var(--text); text-decoration: none; }
.scene-link:hover a { color: var(--primary); }

.scene-link-del {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  background: transparent;
  color: var(--text-faint);
  border: 0;
  border-radius: 50%;
  font-size: .9rem;
  line-height: 1;
}

.scene-link-del:hover { background: var(--ls-danger-tint); color: var(--error); }

.scene-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--ls-hairline);
}

/* =====================================================================
   30. AI 门户 · 常驻 AI 助手（悬浮岛 + 侧边抽屉 + 草稿纸）
   ===================================================================== */
.ai-island {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-ls-island);
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--primary), var(--primary-light));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(var(--primary-rgb), .42);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.ai-island i.material-icons { font-size: 1.5rem; }

.ai-island:hover {
  background: linear-gradient(140deg, var(--primary-hover), var(--primary));
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(var(--primary-rgb), .5);
}

.ai-island.active {
  transform: scale(.94) rotate(-8deg);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), .35);
}

body.ai-drawer-open { overflow: hidden; }

.ai-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-ls-mask);
  background: rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: ls-fade-in .22s var(--ease);
}

@keyframes ls-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-ls-drawer);
  display: flex;
  flex-direction: column;
  width: min(94vw, 430px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 36px rgba(0, 0, 0, .24);
  transform: translateX(102%);
  transition: transform .24s var(--ease);
}

.ai-drawer.open { transform: translateX(0); }

.ai-drawer-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--ls-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.ai-drawer-title {
  flex: 0 0 auto;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
}

.ai-tabs {
  flex: 1 1 auto;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  justify-content: center;
}

.ai-tab {
  min-height: 26px;
  padding: 0 14px;
  background: transparent;
  color: var(--text-light);
  border: 0;
  border-radius: var(--radius-pill);
  font-size: .82rem;
  font-weight: 500;
}

.ai-tab:hover { background: transparent; color: var(--primary); }

.ai-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.ai-pane {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* --- 会话条与列表 --- */
.ai-conv-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ls-hairline);
}

.ai-conv-current {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  cursor: text;
}

#aiConvToggle.active,
#aiConvToggle[aria-expanded="true"] {
  background: var(--ls-tint);
  color: var(--primary);
  border-color: var(--primary);
}

.ai-conv-list {
  max-height: 42%;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.conv-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 4px 6px;
  color: var(--text-faint);
  font-size: .76rem;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
}

.conv-item.active { border-color: var(--primary); background: var(--ls-tint); }

.conv-open {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 1px;
  min-height: 0;
  padding: 6px 8px;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: var(--radius);
  text-align: left;
  font-weight: 400;
}

.conv-open:hover { background: transparent; color: var(--primary); }
.conv-item.active .conv-open { color: var(--primary); }

.conv-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .84rem;
  font-weight: 500;
}

.conv-meta { display: block; color: var(--text-faint); font-size: .72rem; }

.conv-actions { flex: 0 0 auto; display: inline-flex; gap: 0; }
.conv-actions .icon-btn { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }

/* --- 消息区 --- */
.ai-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 88%;
  animation: ls-msg-in .2s var(--ease);
}

@keyframes ls-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-assistant { align-self: flex-start; }

.msg-body {
  padding: 9px 12px;
  border-radius: var(--radius-lg);
  font-size: .9rem;
  line-height: 1.75;
  word-break: break-word;
}

.msg-user .msg-body {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: var(--radius-sm);
}

.msg-assistant .msg-body {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--ls-hairline);
  border-bottom-left-radius: var(--radius-sm);
}

.msg-text > :first-child { margin-top: 0; }
.msg-text > :last-child { margin-bottom: 0; }
.msg-text p { margin: .45em 0; }
.msg-text ul,
.msg-text ol { margin: .45em 0; padding-left: 1.3em; }
.msg-text li { margin: .18em 0; }
.msg-text h3,
.msg-text h4,
.msg-text h5,
.msg-text h6 { margin: .7em 0 .3em; font-size: 1em; font-weight: 600; }
.msg-text blockquote {
  margin: .6em 0;
  padding-left: .8em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-light);
}
.msg-text a { color: inherit; text-decoration: underline; }
.msg-assistant .msg-text a { color: var(--primary); }

.msg-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.msg-img {
  width: 120px;
  max-width: 46vw;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--ls-hairline);
}

.msg-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: currentColor;
  vertical-align: text-bottom;
  animation: ls-caret .9s step-end infinite;
}

@keyframes ls-caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.msg-flag {
  margin-left: 6px;
  color: var(--text-faint);
  font-size: .78rem;
}

.msg-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.msg:hover .msg-foot,
.msg:focus-within .msg-foot { opacity: 1; }

.msg-time { color: var(--text-faint); font-size: .72rem; }
.msg-foot .icon-btn { width: 24px; height: 24px; min-width: 24px; min-height: 24px; }
.msg-foot .icon-btn i.material-icons { font-size: .95rem; }

.msg-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--ls-hairline);
  font-size: .78rem;
}

.msg-sources a { color: var(--primary); text-decoration: none; }
.msg-sources a:hover { text-decoration: underline; }

.msg-hint {
  margin: auto;
  padding: 0 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: .88rem;
  line-height: 1.75;
}

.msg-hint p { margin: 0 0 .5em; }

.ai-loading {
  margin: 8px 0;
  color: var(--text-faint);
  font-size: .86rem;
  animation: ls-pulse 1.4s ease-in-out infinite;
}

/* --- 登录 / 未配置提示 --- */
.ai-config-prompt {
  margin: 12px;
  padding: 12px 14px;
  background: var(--ls-tint);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: .86rem;
  line-height: 1.75;
}

.ai-config-prompt p { margin: 0 0 .5em; }
.ai-config-prompt .btn { margin-top: 4px; }

/* --- 输入区 --- */
.ai-composer {
  flex: 0 0 auto;
  position: relative;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.ai-composer.gated { opacity: .72; }

.ai-drop-hint {
  position: absolute;
  inset: 6px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--ls-tint-strong);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--primary);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

#aiInput {
  width: 100%;
  min-height: 44px;
  max-height: 150px;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  line-height: 1.6;
  resize: none;
  overflow-y: auto;
}

#aiInput:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .18);
}

.ai-composer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.ai-composer-actions .btn.small { margin-left: auto; }

.ai-notice {
  min-height: 1.2em;
  margin: 6px 0 0;
  color: var(--text-faint);
  font-size: .78rem;
  line-height: 1.5;
}

.ai-notice.ok { color: var(--success); }
.ai-notice.warn { color: var(--warning); }
.ai-notice.error { color: var(--error); }

/* --- 待发送附件 --- */
.ai-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 3px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: .76rem;
  color: var(--text-light);
}

.attach-chip img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
}

.attach-name {
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.attach-del {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  background: transparent;
  color: var(--text-faint);
  border: 0;
  border-radius: 50%;
  font-size: .95rem;
  line-height: 1;
}

.attach-del:hover { background: var(--ls-danger-tint); color: var(--error); }

/* --- 草稿纸 --- */
#aiPaneScratch { padding: 12px; gap: 10px; }

#scratchText {
  flex: 1 1 auto;
  min-height: 180px;
  margin: 0;
  padding: 12px;
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  line-height: 1.7;
  resize: none;
}

#scratchText:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .18);
}

.scratch-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scratch-output.error { border-color: var(--error); }
.scratch-output.ok { border-color: var(--success); }

.scratch-output {
  flex: 0 1 auto;
  max-height: 46%;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .86rem;
  line-height: 1.75;
}

.scratch-out-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: .84rem;
}

.scratch-out-head .icon-btn { width: 26px; height: 26px; min-width: 26px; min-height: 26px; }

.scratch-md > :first-child { margin-top: 0; }
.scratch-md > :last-child { margin-bottom: 0; }
.scratch-md p { margin: .5em 0; }
.scratch-md ul,
.scratch-md ol { margin: .5em 0; padding-left: 1.3em; }
.scratch-md a { color: var(--primary); }

/* =====================================================================
   31. AI 门户 · 响应式
   ===================================================================== */
@media (max-width: 768px) {
  .brief-bar { margin-top: 56px; }
  .dash-cards { grid-template-columns: 1fr; }
  .search-suggest,
  .search-panel { width: min(100%, calc(100vw - 24px)); }
  .msg { max-width: 94%; }
}

@media (max-width: 600px) {
  .dash-zone { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .ai-conv-current { font-size: .82rem; }
  .quote-chg { min-width: 74px; font-size: .74rem; }
  .wx-day { min-width: 56px; }
  .search-panel { max-height: min(52vh, 420px); }
  .mail-actions .btn.small { flex: 1 1 auto; }
}

@media (max-width: 480px) {
  #toolDock { top: 8px; right: 8px; padding: 3px; }
  #toolDock .action-btn { width: 34px; height: 34px; min-height: 34px; }
  .brief-bar { margin-top: 52px; padding: 12px; }
  .brief-greeting { font-size: .9rem; }
  .ai-island { right: 14px; bottom: 14px; width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
  .ai-drawer { width: 100vw; }
  .ai-drawer-header { padding: 8px 10px; }
  .ai-tab { padding: 0 10px; }
  .ai-summary-sources { font-size: .74rem; }
}

/* =====================================================================
   32. AI 门户 · 减少动态效果、强制颜色与打印
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .ai-island,
  .ai-drawer,
  .ls-toast,
  .dash-card,
  .engine-result,
  .ai-tab { transition: none; }

  .ai-summary-card.streaming .ai-summary-head i.material-icons,
  .brief-loading,
  .card-loading,
  .ai-loading,
  .ai-summary-loading,
  .msg-caret,
  .quote-row.alert { animation: none; }

  .msg { animation: none; }
  .search-suggest,
  .search-panel,
  .ai-drawer-mask { animation: none; }
}

@media (forced-colors: active) {
  #toolDock,
  .brief-bar,
  .ai-drawer,
  .ai-drawer-mask,
  .search-suggest,
  .search-panel,
  .dash-card,
  .ls-toast { border: 1px solid CanvasText; }

  .ai-island { border: 1px solid ButtonText; }
  .quote-row.alert { outline: 2px solid CanvasText; outline-offset: -2px; }
}

@media print {
  #toolDock,
  .brief-actions,
  .dash-toggle,
  .ai-island,
  .ai-drawer,
  .ai-drawer-mask,
  .ls-toast-wrap,
  .search-suggest,
  .search-panel,
  .card-tools,
  .todo-actions,
  .rss-actions,
  .scene-actions { display: none !important; }

  .brief-bar,
  .dash-card,
  .dash-zone { box-shadow: none; border-color: #999; }

  .dash-card.folded .card-body { display: block; }
  .brief-bar { margin-top: 0; }
  .dash-zone { padding: 0; }
}

/* =====================================================================
   33. AI 门户 · 首屏密度 · 悬浮岛位置 · 小组件尺寸（末尾覆盖层）
   ---------------------------------------------------------------------
   本分节位于文件末尾，用于覆盖前文同名规则，改动集中在此，方便回滚。
   ===================================================================== */

/* --- 首屏密度：简报 / 搜索 / 仪表盘进第一屏，不再需要滚动 --- */
main {
  flex: 0 0 auto;
  min-height: 0;
  padding: 56px var(--sp-4) 18px;
  justify-content: flex-start;
}

/* 简报可见时，它自身已提供顶部留白，主区域不再重复留白 */
.brief-bar:not([hidden]) + main { padding-top: 16px; }

.brief-bar {
  margin: 58px auto 0;
  padding: 12px 14px;
}

.input-box { margin: 0 auto 24px; }

.dash-zone { padding-bottom: 18px; }
.dash-cards { margin-bottom: 8px; }
.dash-toggle { min-height: 36px; }

footer { margin-top: auto; }

/* --- 常驻 AI 助手：悬浮岛移到左上角，与工具条按钮同风格 --- */
#aiIsland.ai-island {
  position: fixed;
  top: 12px;
  left: 12px;
  right: auto;
  bottom: auto;
  z-index: var(--z-ls-dock);
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ls-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  color: var(--text-light);
  border: 1px solid var(--ls-hairline);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}

#aiIsland.ai-island i.material-icons { font-size: 1.35em; }

#aiIsland.ai-island:hover {
  background: var(--ls-tint-strong);
  color: var(--primary);
  transform: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

#aiIsland.ai-island.active {
  background: var(--ls-tint-strong);
  color: var(--primary);
  transform: scale(.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
}

/* --- 小组件：文字不溢出、可自定义尺寸 --- */
.dash-card { min-width: 0; }
.dash-cards > * { min-width: 0; }

.dash-card .card-head h3 {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dash-card .card-sub { min-width: 0; }

.card-head .card-tools .icon-btn,
.card-head .card-tools .card-fold,
.card-head .card-tools .card-size {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

/* 长链接、长单词、AI 生成的长句都必须在卡片内换行 */
.card-body,
.card-body *,
.brief-list li,
.direct-card,
.direct-card *,
.rss-summary,
.scratch-output,
.msg-text,
.scratch-md {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.rss-items li a,
.scene-link a,
.city-item,
.wx-chip,
.quote-name,
.todo-text { overflow-wrap: anywhere; }

.rss-items,
.scene-links,
.quote-list,
.todo-list,
.wx-indices { max-width: 100%; }

/* 卡片宽度：auto 自适应；2/3/4 为固定每行数量 */
.dash-cards { grid-template-columns: repeat(auto-fill, minmax(min(272px, 100%), 1fr)); }
.dash-cards[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-cards[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-cards[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 单张卡片跨列 */
.dash-card[data-w="2"] { grid-column: span 2; }
.dash-card[data-w="full"] { grid-column: 1 / -1; }

/* 卡片高度：紧凑 / 标准 / 宽松 / 自适应 */
.dash-cards[data-h="compact"] { --dash-body-max: 128px; }
.dash-cards[data-h="std"] { --dash-body-max: 224px; }
.dash-cards[data-h="tall"] { --dash-body-max: 368px; }
.dash-cards[data-h="auto"] { --dash-body-max: none; }

.dash-card .card-body {
  max-height: var(--dash-body-max, 224px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dash-card [data-card="todo"],
.dash-card[data-card="todo"] .card-body { overflow: visible; }

/* 卡片尺寸按钮的当前值提示 */
.card-size::after {
  content: "";
}

.set-hint {
  margin: 4px 0 10px;
  color: var(--text-faint);
  font-size: .78rem;
  line-height: 1.6;
}

.set-grid {
  display: grid;
  gap: 4px;
}

@media (max-width: 1100px) {
  .dash-cards[data-cols="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dash-cards[data-cols="3"],
  .dash-cards[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .dash-cards,
  .dash-cards[data-cols="2"],
  .dash-cards[data-cols="3"],
  .dash-cards[data-cols="4"] { grid-template-columns: 1fr; }

  .dash-card[data-w="2"],
  .dash-card[data-w="full"] { grid-column: auto; }

  .dash-cards[data-h="auto"] { --dash-body-max: none; }

  .brief-bar { margin-top: 52px; padding: 12px; }
  .brief-bar:not([hidden]) + main { padding-top: 14px; }
  main { padding-left: var(--sp-3); padding-right: var(--sp-3); }
}

@media (max-width: 480px) {
  #aiIsland.ai-island {
    top: 8px;
    left: 8px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
}

@media print {
  .card-size { display: none !important; }
  .dash-card .card-body { max-height: none; overflow: visible; }
}

/* =====================================================================
   34. AI 门户 · 上一节的修正（同文件末尾，覆盖写错的规则）
   ===================================================================== */

/* 待办卡片同样遵循高度预设，卡片内滚动，不再让内容撑破卡片 */
.dash-card[data-card="todo"] .card-body,
.dash-card .card-body {
  max-height: var(--dash-body-max, 260px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 高度预设：紧凑 / 标准 / 宽松（数值按实际卡片内容微调） */
.dash-cards[data-h="compact"] { --dash-body-max: 150px; }
.dash-cards[data-h="std"] { --dash-body-max: 260px; }
.dash-cards[data-h="tall"] { --dash-body-max: 380px; }
.dash-cards[data-h="auto"] { --dash-body-max: none; }

.dash-cards[data-h="auto"] .dash-card .card-body {
  max-height: none;
  overflow-x: visible;
  overflow-y: visible;
}

/* --- 卡片宽度按钮：小药丸，直接显示「1 列 / 2 列 / 整行」 --- */
.card-head .card-tools .card-size {
  width: auto;
  min-width: 0;
  height: 22px;
  min-height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-muted);
  color: var(--text-light);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.card-head .card-tools .card-size:hover {
  background: var(--ls-tint-strong);
  color: var(--primary);
  border-color: var(--primary);
}

@media print {
  .card-size { display: none !important; }
}

/* --- 场景卡片：去掉标题栏那行文字（「场景」标题与「N 组快捷链接」提示），只留按钮 --- */
.dash-card[data-card="scene"] .card-head > i.material-icons,
.dash-card[data-card="scene"] .card-head > h3,
.dash-card[data-card="scene"] .card-head > .card-sub {
  display: none;
}

.dash-card[data-card="scene"] .card-head {
  justify-content: flex-end;
  min-height: 22px;
}

/* =====================================================================
   35. AI 门户 · 搜索浮层互斥（联想词 vs 结果面板）
   ---------------------------------------------------------------------
   这两块浮层定位完全相同（§28 注释里写的「共用定位」），只靠 JS 的
   hideSuggest() 维持「同时只出现一个」。但联想请求有 180ms 防抖，迟到的
   响应会在结果面板已经打开后又把联想列表显示出来；面板打开时再点回搜索框
   输入也会这样。两者都是半透明毛玻璃背景，叠在一起会互相透出文字。

   所以这里补一道样式层的硬约束：结果面板可见时，联想词一律让位。
   ===================================================================== */
.navi-search:has(#searchPanel:not([hidden])) #searchSuggest {
  display: none !important;
}

/* 兜底：万一浏览器不支持 :has()，也让结果面板压在联想词之上 */
.navi-search #searchPanel {
  z-index: calc(var(--z-ls-panel) + 2);
}

/* =====================================================================
   36. AI 门户 · 卡片标题栏移除后的控件条
   ---------------------------------------------------------------------
   <header class="card-head"> 整个从 DOM 里删掉了（图标 / 标题 / 副标题都不要），
   只把右侧的「宽度 / 折叠」两个按钮挪成卡片顶部一小条，默认透明，
   鼠标悬停或卡片处于折叠状态时才显示（触屏设备常显）。
   ===================================================================== */
.card-tools-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-height: 20px;
  margin-bottom: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.dash-card:hover .card-tools-row,
.dash-card:focus-within .card-tools-row,
.dash-card.folded .card-tools-row { opacity: 1; }

@media (hover: none) {
  .card-tools-row { opacity: .7; }
}

.card-tools-row .icon-btn,
.card-tools-row .card-fold {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
}

.card-tools-row .card-size {
  width: auto;
  min-width: 0;
  height: 20px;
  min-height: 20px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-muted);
  color: var(--text-light);
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.card-tools-row .card-size:hover {
  background: var(--ls-tint-strong);
  color: var(--primary);
  border-color: var(--primary);
}

/* 卡片现在直接从内容开始，去掉标题栏残留的顶部间距 */
.dash-card { padding-top: 8px; }

/* --- 天气卡片：标题栏删掉后，城市名改在卡片内显示一小行 --- */
.wx-city {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 6px;
  color: var(--text-faint);
  font-size: .78rem;
  line-height: 1.4;
}

.wx-city i.material-icons {
  font-size: 1rem;
  color: var(--primary);
}

/* --- 标题栏销毁的兜底：元素本身由 start-settings.js 从 DOM 里删掉，
       这里再压一层，保证 JS 还没跑到时也不会闪一下标题栏 --- */
.card-head { display: none !important; }

/* =====================================================================
   37. AI 门户 · 自由窗口布局与编辑模式
   ===================================================================== */

/* 自由布局：卡片变成可拖动、可缩放的「窗口」 */
.dash-cards.dash-free {
  position: relative;
  display: block;
  margin-bottom: 10px;
}

.dash-cards.dash-free .dash-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.dash-cards.dash-free .dash-card .card-body {
  flex: 1 1 auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

/* 自由布局下「几列 / 多高」由窗口尺寸说了算，旧的宽度小药丸收起来 */
.card-size { display: none !important; }

.dash-card.free-hidden { display: none !important; }

/* --- 编辑模式的工具条（在仪表盘上方） --- */
.dash-edit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--ls-glass);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.dash-edit-bar[hidden] { display: none !important; }

.dash-edit-bar .dash-edit-title {
  margin-right: auto;
  font-size: .82rem;
  color: var(--text-faint);
}

.dash-edit-bar .btn { min-height: 28px; }

/* --- 卡片上的拖动条（仅编辑模式出现） --- */
.card-edit-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -6px -8px 8px;
  padding: 3px 6px;
  background: var(--ls-tint);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: .78rem;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.card-edit-bar b {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
}

.card-edit-bar .icon-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
}

/* --- 右下角缩放手柄 --- */
.card-resize {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  border-radius: 0 0 4px 0;
  opacity: .5;
  cursor: nwse-resize;
  touch-action: none;
}

.card-resize:hover { opacity: 1; }

/* --- 编辑态视觉提示 --- */
body.dash-editing .dash-card { outline: 1px dashed var(--primary); outline-offset: 2px; }
.dash-card.dragging { z-index: 6; opacity: .92; box-shadow: var(--shadow-lg); }

/* --- 「添加组件」小菜单 --- */
.dash-add-menu {
  position: absolute;
  z-index: 1300;
  min-width: 160px;
  padding: 6px;
  background: var(--ls-glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

.dash-add-menu button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: var(--radius);
  font-size: .86rem;
  text-align: left;
  cursor: pointer;
}

.dash-add-menu button:hover { background: var(--ls-tint-strong); color: var(--primary); }
.dash-add-menu .dash-add-empty { padding: 6px 10px; color: var(--text-faint); font-size: .8rem; }

/* --- 方案（设置弹窗里新加的一组） --- */
.ls-plan-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* --- 窄屏：自由布局自动退回排列，编辑手柄收起 --- */
@media (max-width: 640px) {
  .dash-cards.dash-free { display: grid; }
  .dash-cards.dash-free .dash-card { position: static; }
  .card-edit-bar,
  .card-resize { display: none !important; }
}

/* =====================================================================
   38. AI 门户 · 页面区块自由布局（搜索框 / 日报 / 导航项 / 仪表盘）
   ===================================================================== */

/* 编辑模式下所有区块都露出轮廓，并能承载控制条 */
body.dash-editing #briefBar,
body.dash-editing .navi-search,
body.dash-editing .navi-items,
body.dash-editing #dashCards {
  position: relative;
  outline: 1px dashed var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* 自由摆放模式：区块脱离文档流，坐标就是页面坐标（不需要搬 DOM） */
body.ls-canvas #briefBar,
body.ls-canvas .navi-search,
body.ls-canvas .navi-items,
body.ls-canvas #dashCards {
  position: absolute;
  margin: 0;
}

body.ls-canvas main { padding: 0; min-height: 0; }
body.ls-canvas .input-box { max-width: none; margin: 0; }
body.ls-canvas .brief-bar:not([hidden]) + main { padding-top: 0; }
body.ls-canvas .dash-zone { padding: 0; }

/* 画布模式下：仪表盘那排按钮与编辑工具条浮到底部，不占版面 */
body.ls-canvas .dash-zone > .dash-toggle,
body.ls-canvas .dash-zone > #dashEditBtn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  min-width: 132px;
  z-index: var(--z-ls-dock);
}

body.ls-canvas .dash-zone > #dashEditBtn { bottom: 54px; }
body.ls-canvas .dash-zone > .dash-toggle { bottom: 10px; }

body.ls-canvas .dash-edit-bar {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  width: min(96vw, 760px);
  z-index: var(--z-ls-dock);
}

/* --- 区块控制条（拖动把手 + 关闭） --- */
.ls-block-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: -28px;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  background: var(--ls-tint-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .76rem;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  z-index: 3;
}

.ls-block-bar b {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
}

.ls-block-bar .icon-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

/* --- 区块缩放手柄 --- */
.ls-block-resize {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  border-radius: 0 0 4px 0;
  opacity: .55;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 3;
}

.ls-block-resize:hover { opacity: 1; }
.ls-block-hidden { display: none !important; }
.ls-block-dragging { opacity: .92; }

/* 窄屏：画布模式自动关掉，回到原来的纵向排列 */
@media (max-width: 640px) {
  body.ls-canvas #briefBar,
  body.ls-canvas .navi-search,
  body.ls-canvas .navi-items,
  body.ls-canvas #dashCards { position: static; width: auto !important; height: auto !important; }
  .ls-block-bar,
  .ls-block-resize { display: none !important; }
}

/* =====================================================================
   39. AI 门户 · 简化版：小组件面板 + 导航项 ＋ 磁贴
   ---------------------------------------------------------------------
   注：§37「自由窗口布局」与 §38「页面区块画布」已停用（对应的 JS 已删除）。
       这些选择器不再有元素匹配；保留它们只是为了兼容「还在用旧缓存页面」的
       情况，等缓存自然过期后可以整段删掉。
   ===================================================================== */

/* --- 导航项网格末尾的「添加」磁贴 --- */
.navi-items .navi-add {
  opacity: .72;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: transparent;
  transition: opacity var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}

.navi-items .navi-add:hover {
  opacity: 1;
  border-color: var(--primary);
}

.navi-items .navi-add .navi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* --- 「管理导航项」弹窗里的「小组件」一栏 --- */
.ls-widget-list {
  display: grid;
  gap: 4px;
  margin: 4px 0 6px;
}

.ls-widget-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: 1px solid var(--ls-hairline);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.ls-widget-name {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .88rem;
}

.ls-widget-name input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.ls-widget-move {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 2px;
}

.ls-widget-move .icon-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
}

.ls-widget-move .icon-btn[disabled] {
  opacity: .3;
  cursor: default;
}

/* --- 卡片不再有内部滚动条：高度跟着内容走，网格按内容对齐 --- */
.dash-cards { align-items: start; }

.dash-card .card-body {
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
}

/* =====================================================================
   40. 页面自由布局 · 编辑模式外观（布局常开，编辑态另行提示）
   ===================================================================== */

/* 编辑模式：区块露出轮廓。
   注意这里**不写 position** —— 区块的定位由 §38 的画布规则决定，
   这里只在编辑态加一圈虚线提示，避免把 absolute 覆盖回 relative。 */
body.ls-editing #briefBar,
body.ls-editing .navi-search,
body.ls-editing .navi-items,
body.ls-editing #dashCards {
  outline: 1px dashed var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* 右下角浮动的「完成编辑」 */
#lsDoneBtn {
  position: fixed;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  z-index: 1200; /* 必须压过 .modal 的 1100，编辑弹窗开着时也能点到它 */
  gap: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

/* 导航项的「＋ 添加」磁贴：默认不显示，只在编辑模式出现 */
.navi-items .navi-add.ls-tile-hidden { display: none !important; }
body.ls-editing .navi-items .navi-add.ls-tile-hidden { display: none !important; }

/* 「编辑」弹窗里的「页面区块」一栏 */
#ls-block-list { margin-bottom: 4px; }

#ls-widget-panel blockquote {
  margin: 10px 0 6px;
  color: var(--primary);
  font-size: .84rem;
  font-weight: 600;
}

/* =====================================================================
   41. 「编辑」弹窗 → 右侧抽屉
   ---------------------------------------------------------------------
   只覆盖 #modal-manage（导航项 + 小组件 + 页面区块这一套），
   「更新日志 / 关于 / 设置」三个弹窗仍然是居中样式，不受影响。

   可见性完全沿用 main.js 的 .active：只有点右上角那支铅笔
   （或导航项末尾的「＋ 添加」）才会出现；点遮罩、✕、Esc 都能收起。
   这里只改「长什么样、待在哪儿」，不动任何 DOM 结构，
   所以 main.js 里那些按选择器缓存的节点引用、拖拽排序逻辑都照旧可用。
   ===================================================================== */
#modal-manage {
  padding: 0;
  justify-content: flex-end;          /* 内容贴右边，元素本身仍是铺满的遮罩 */
  background: rgba(0, 0, 0, .38);
}

#modal-manage .modal-content {
  width: min(94vw, 430px);
  max-width: none;
  margin: 0;
  height: auto;
  max-height: none;
  align-self: stretch;                /* 占满整屏高度 */
  padding: 18px 18px 28px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: ls-drawer-in .22s var(--ease);
}

@keyframes ls-drawer-in {
  from { transform: translateX(20px); opacity: .5; }
  to { transform: translateX(0); opacity: 1; }
}

/* 抽屉标题吸顶，列表滚动时一直看得见 */
#modal-manage .modal-header {
  position: sticky;
  top: -18px;
  z-index: 2;
  margin: -18px -18px 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--ls-hairline);
}

/* 抽屉比原来的弹窗窄，预设导航项改小一点的格子，避免挤成两栏看不清 */
#modal-manage .sites { grid-template-columns: repeat(auto-fill, minmax(5.6em, 1fr)); }

/* 抽屉里长列表的收尾留白 */
#modal-manage fieldset:last-child { margin-bottom: 12px; }

@media (max-width: 480px) {
  #modal-manage .modal-content { width: 100vw; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #modal-manage .modal-content { animation: none; }
}
