/* 用户手册页（home/docs/，build-docs.mjs 生成）：左目录 + 右正文 + 右下角问 AI */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; padding-top: 32px; padding-bottom: 64px; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; gap: 16px; } }

.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 14px; }
.toc summary { font-weight: 600; cursor: pointer; padding: 6px 0 10px; color: var(--muted); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc a { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--muted); line-height: 1.45; }
.toc a span { font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); opacity: .7; flex: none; }
.toc a:hover { color: var(--ink); background: var(--card); }
.toc a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: inset 2px 0 0 var(--gold); }
@media (max-width: 900px) { .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; } }

.doc { min-width: 0; font-size: 16px; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 20px; }
.doc h2 { font-size: 22px; margin: 44px 0 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 17px; margin: 28px 0 10px; }
.doc p, .doc li { color: #c9d0d9; }
.doc a { color: var(--gold2); text-decoration: underline; text-decoration-color: rgba(214, 168, 78, .4); text-underline-offset: 3px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc strong { color: var(--ink); }
.doc code { font: 13.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.doc pre { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.doc pre code { border: 0; padding: 0; background: none; }
.doc blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--gold); color: var(--muted); background: var(--bg2); border-radius: 0 8px 8px 0; }
.doc table { display: block; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--card); color: var(--ink); white-space: nowrap; }
.doc .ask-hint { margin-top: 48px; padding: 14px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 14px; }

/* 问 AI 挂件 */
.ask-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #1a1406; font: 600 15px/1 inherit;
  padding: 13px 18px; border-radius: 999px; box-shadow: 0 10px 30px -10px rgba(214, 168, 78, .7); }
.ask-panel { position: fixed; right: 20px; bottom: 76px; z-index: 60; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 110px));
  display: none; flex-direction: column; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8); }
.ask-panel.open { display: flex; }
.ask-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.ask-head button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.ask-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.ask-msg { padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; max-width: 92%; }
.ask-msg.me { align-self: flex-end; background: rgba(214, 168, 78, .15); }
.ask-msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); }
.ask-msg.ai a { color: var(--gold2); }
.ask-msg.err { color: #ff8a7a; }
.ask-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ask-form textarea { flex: 1; resize: none; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14.5px; }
.ask-form button { border: 0; border-radius: 10px; padding: 0 14px; background: var(--gold); color: #1a1406; font-weight: 600; cursor: pointer; }
.ask-form button:disabled { opacity: .5; cursor: default; }
