:root {
  --ink: #0f172a; --muted: #454f5e; --accent: #6528f7; --accent-hover: #5511f8;
  --border: #d8d8f5; --surface: #fff; --background: #f2f0fe;
  --soft: #f8f7fe; --code-background: #0b111b; --code-text: #c5d1df;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .5; }
.page-shell { width: min(1184px, calc(100% - 56px)); margin: 36px auto 48px; min-height: calc(100vh - 84px); }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.intro-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.standalone-nav { display: flex; gap: 10px; font-size: 13px; }
.standalone-nav a { color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 6px 11px; background: var(--surface); white-space: nowrap; }
.standalone-nav a:hover { color: var(--accent); border-color: var(--accent); }
.standalone-nav i { margin-right: 3px; }
.eyebrow { font-size: 12px; color: var(--accent); font-weight: 650; margin: 0 0 6px; letter-spacing: .5px; }
h1 { margin: 0; font-size: 36px; line-height: 1.3; font-weight: 750; letter-spacing: -.8px; }
.intro-text { margin: 10px 0 0; color: var(--muted); }
.index-summary { display: flex; gap: 24px; color: var(--muted); font-size: 13px; padding-bottom: 4px; white-space: nowrap; }
.index-summary strong { color: var(--ink); font-size: 21px; font-weight: 650; margin-right: 3px; }
.search-panel { padding: 23px 26px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 24px; }
.search-label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 10px; }
.search-field { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 16px; border: 1px solid var(--border); background: var(--soft); border-radius: 7px; transition: border-color .16s, box-shadow .16s; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #6528f710; background: var(--surface); }
.search-field > i { color: var(--accent); font-size: 19px; }
.search-field input { min-width: 0; flex: 1; width: 100%; padding: 14px 0; border: 0; background: transparent; color: var(--ink); outline: none; font-size: 16px; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field input::placeholder { color: #737b8a; }
.search-shortcut { border: 1px solid var(--border); color: var(--muted); border-radius: 4px; padding: 0 7px; font: 13px/24px var(--font); }
.clear-search { border: 0; background: transparent; color: var(--muted); padding: 4px; }
.search-help { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.panel-heading { padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #eeedf8; }
h2 { font-size: 18px; font-weight: 650; line-height: 1.5; margin: 0; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.text-button { color: var(--accent); background: transparent; border: none; padding: 6px 0 6px 8px; white-space: nowrap; font-size: 13px; }
.text-button i { margin-left: 5px; font-size: 11px; }
.directory-tree { padding: 12px 26px 22px; }
.directory-node, .directory-leaf { margin: 0; }
.directory-node > summary, .directory-leaf { padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-radius: 6px; min-width: 0; }
.directory-node > summary { list-style: none; cursor: pointer; }
.directory-node > summary::-webkit-details-marker { display: none; }
.directory-node > summary:hover, .directory-leaf:hover { background: var(--soft); }
.directory-chevron { color: #72778b; font-size: 11px; width: 12px; flex: 0 0 12px; transition: transform .15s; }
.directory-node[open] > summary .directory-chevron { transform: rotate(90deg); }
.directory-node > summary > .bi-folder2, .directory-leaf > .bi-folder2 { color: var(--accent); font-size: 18px; }
.directory-label { overflow-wrap: anywhere; font-size: 14px; }
.directory-root > summary .directory-label { font-weight: 600; }
.directory-count { margin-left: auto; color: #70798a; font-size: 11px; padding-left: 10px; white-space: nowrap; }
.directory-children { margin: 0 0 4px 25px; padding-left: 14px; border-left: 1px solid #e9e6f8; }
.directory-spacer { width: 12px; flex: 0 0 12px; }
.result-note { font-size: 12px; color: #70798a; white-space: nowrap; }
.file-row { display: flex; align-items: center; gap: 16px; padding: 22px 26px; border-bottom: 1px solid #eeedf8; transition: background .15s; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #fcfbff; }
.file-type { flex: 0 0 44px; width: 44px; height: 48px; border-radius: 6px; color: var(--accent); background: #f0eafe; display: grid; place-items: center; font: 650 10px/1 var(--font); letter-spacing: .5px; }
.file-info { min-width: 0; flex: 1; }
.file-name { font-size: 15px; line-height: 1.6; font-weight: 650; overflow-wrap: anywhere; }
mark { background: #eae0fe; color: #4f16c7; border-radius: 2px; padding: 0 1px; }
.file-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 5px; }
.file-path { font-size: 12px; color: #70798a; margin-top: 5px; overflow-wrap: anywhere; }
.file-path i { margin-right: 6px; }
.file-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 7px 11px; line-height: 1.5; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.button:hover { border-color: var(--accent); color: var(--accent); background: var(--soft); }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.empty-state { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-state > i { display: inline-block; color: var(--accent); font-size: 26px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; color: var(--ink); margin: 0; }
.empty-state p { font-size: 13px; margin: 8px 0 0; }
.preview-dialog { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0; width: min(1120px, calc(100vw - 48px)); max-width: none; max-height: 88vh; color: var(--ink); box-shadow: 0 24px 80px #0f172a33; }
.preview-dialog::backdrop { background: #11152a88; }
body:has(.preview-dialog[open]) { overflow: hidden; }
.preview-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; }
.preview-heading { min-width: 0; }
.preview-heading h2 { margin-top: 4px; overflow-wrap: anywhere; font-size: 17px; }
.preview-heading p { color: var(--muted); font-size: 12px; margin: 4px 0 0; overflow-wrap: anywhere; }
.preview-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.icon-button { border: 0; background: transparent; padding: 7px; color: var(--muted); border-radius: 5px; }
.icon-button:hover { background: var(--soft); color: var(--accent); }
.preview-status { font-size: 13px; color: var(--muted); padding: 0 24px 14px; }
.preview-status:empty { display: none; }
.preview-recovery { padding: 0 24px 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.preview-code-area { background: var(--code-background); }
.preview-code, .preview-code[class*="language-"], .preview-code code[class*="language-"] { background: var(--code-background); color: var(--code-text); font: 13px/1.75 "SFMono-Regular", Consolas, "Liberation Mono", monospace; text-shadow: none; border: 0; border-radius: 0; white-space: pre; word-break: normal; overflow-wrap: normal; tab-size: 4; }
.preview-code { margin: 0; padding: 24px; min-height: 160px; max-height: 62vh; overflow: auto; }
.preview-footer { display: flex; justify-content: space-between; gap: 16px; padding: 11px 24px; font-size: 11px; color: var(--muted); }
.preview-footer kbd { font: inherit; border: 1px solid var(--border); padding: 1px 4px; border-radius: 3px; }
@media (max-width: 768px) {
  .page-shell { width: calc(100% - 36px); margin-top: 24px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 18px; }
  .intro-meta { align-items: flex-start; gap: 16px; }
  h1 { font-size: 30px; }
  .index-summary { gap: 22px; }
  .search-panel { padding: 20px; }
  .panel-heading { padding: 20px; }
  .panel-heading p { font-size: 12px; }
  .directory-tree { padding: 10px 12px 18px; }
  .directory-children { margin-left: 16px; padding-left: 8px; }
  .file-row { padding: 20px; gap: 12px; flex-wrap: wrap; }
  .file-actions { width: 100%; padding-left: 56px; }
  .file-type { align-self: flex-start; }
  .result-note { display: none; }
  .preview-dialog { width: calc(100vw - 24px); max-height: 92vh; }
  .preview-header { padding: 18px; align-items: flex-start; gap: 10px; }
  .preview-actions { gap: 4px; }
  .preview-actions .button { padding: 7px 9px; }
  .preview-heading h2 { font-size: 14px; }
  .preview-code { padding: 18px; font-size: 12px; max-height: 65vh; }
  .preview-status, .preview-recovery { padding-left: 18px; padding-right: 18px; }
  .preview-footer { padding: 11px 18px; font-size: 10px; }
}
@media (max-width: 380px) {
  .page-shell { width: calc(100% - 24px); }
  .search-panel { padding: 16px; }
  .search-field { padding: 0 12px; gap: 10px; }
  .search-field input { font-size: 14px; }
  .search-shortcut { display: none; }
  .panel-heading { padding: 16px; }
  .panel-heading p { max-width: 175px; }
  .file-row { padding: 16px; }
  .file-actions { padding-left: 0; }
  .preview-header { flex-wrap: wrap; }
  .preview-actions { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
