/* LVX 站点：暗色/亮色主题（中性黑，无蓝调） */
html[data-theme="dark"] {
  color-scheme: dark;
  --fg:#ededed; --muted:#a3a3a3; --line:#2e2e2e; --soft:#141414; --ink:#1f1f1f;
  --ok:#34d399; --warn:#fbbf24; --err:#f87171; --danger:#f87171;
}
html[data-theme="dark"], html[data-theme="dark"] body { background:#000; color:#ededed; }
html[data-theme="dark"] a { border-bottom-color:#3a3a3a; }

/* 表面与控件 */
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .auth .menu,
html[data-theme="dark"] .card,
html[data-theme="dark"] .app,
html[data-theme="dark"] .item,
html[data-theme="dark"] .installed .row { background:#141414; border-color:var(--line); }
html[data-theme="dark"] .modal { background:rgba(0,0,0,.72); }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select { background:#141414; color:#ededed; border-color:var(--line); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color:#7a7a7a; }
html[data-theme="dark"] .btn-line,
html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .copybtn,
html[data-theme="dark"] .auth .mini { background:transparent; color:var(--fg); border-color:var(--line); }
html[data-theme="dark"] .btn-solid,
html[data-theme="dark"] .auth .mini.solid { border:1px solid #3a3a3a; }
html[data-theme="dark"] code { background:#1e1e1e; color:#ededed; }
html[data-theme="dark"] pre { background:#0a0a0a; color:#e5e5e5; }
html[data-theme="dark"] blockquote { background:#141414; color:#d4d4d4; border-color:#3a3a3a; }
html[data-theme="dark"] .toast { background:#1f1f1f; color:#ededed; border:1px solid var(--line); }
html[data-theme="dark"] .avatar { background:#262626; color:#d4d4d4; }
html[data-theme="dark"] .emblem { background:#1a1a1a; }
html[data-theme="dark"] .kind { background:rgba(45,212,191,.1); border-color:rgba(45,212,191,.35); }
html[data-theme="dark"] .step .k,
html[data-theme="dark"] .meta i,
html[data-theme="dark"] nav .sep,
html[data-theme="dark"] .app .meta i,
html[data-theme="dark"] .item .meta i { color:#6b6b6b; }
html[data-theme="dark"] .agent .dot { background:#5c5c5c; }
html[data-theme="dark"] .app:hover,
html[data-theme="dark"] .item:hover,
html[data-theme="dark"] .installed .row:hover { border-color:#4a4a4a; }
html[data-theme="dark"] .copybtn.ok { border-color:#34d399; color:#34d399; }
html[data-theme="dark"] .err,
html[data-theme="dark"] .modal-card .err { color:#f87171; }

/* 正文颜色 */
html[data-theme="dark"] .lead,
html[data-theme="dark"] .excerpt,
html[data-theme="dark"] .post .excerpt,
html[data-theme="dark"] section p,
html[data-theme="dark"] details p,
html[data-theme="dark"] .item p,
html[data-theme="dark"] .item li,
html[data-theme="dark"] ul.plain,
html[data-theme="dark"] .road ul,
html[data-theme="dark"] .danger p,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .content p,
html[data-theme="dark"] .content li,
html[data-theme="dark"] .content blockquote { color:#d4d4d4; }

/* 文档页 */
html[data-theme="dark"] .content a { border-bottom-color:#3a3a3a; }
html[data-theme="dark"] .content th { background:#141414; }
html[data-theme="dark"] .jsonbox { background:#141414; border-color:var(--line); }
html[data-theme="dark"] .tree .kids,
html[data-theme="dark"] .side { border-color:var(--line); }
html[data-theme="dark"] .tree a.sec.l1 { color:#d4d4d4; }
html[data-theme="dark"] .tree a.sec.on { color:#ededed; }
html[data-theme="dark"] .content a:hover,
html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .btn-line:hover,
html[data-theme="dark"] .copybtn:hover,
html[data-theme="dark"] .app:hover,
html[data-theme="dark"] .item:hover { border-color:#4a4a4a; }

/* 主题切换按钮 */
.theme-toggle {
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0; flex:0 0 auto;
  border:1px solid var(--line,#e5e7eb); border-radius:6px;
  background:transparent; color:var(--muted,#6b7280);
  font-size:14px; line-height:1; cursor:pointer;
}
.theme-toggle:hover { color:var(--fg,#111827); border-color:currentColor; }
header.has-theme-toggle { position:relative; }
header.has-theme-toggle > .theme-toggle { position:absolute; left:clamp(22px,3.2vw,64px); top:14px; }

/* ============ 可访问性 ============ */
/* 键盘焦点清晰可见（仅键盘操作时出现） */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
  border-radius: 4px;
}
html[data-theme="dark"] :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline-color: #2dd4bf;
}
/* 主题按钮触控尺寸 */
.theme-toggle { min-width: 34px; min-height: 34px; }
/* 尊重"减少动态效果"系统设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* 仅供读屏的文本 */
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
