:root {
  color-scheme: light;
  --page: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #f1f3f6;
  --surface-hover: #e9edf3;
  --text: #20242c;
  --text-soft: #5d6572;
  --text-faint: #89919e;
  --line: #e1e5eb;
  --line-strong: #cdd3dc;
  --accent: #2f6fed;
  --accent-strong: #1e55c6;
  --accent-soft: #e9f0ff;
  --action: #2f64cc;
  --danger: #c04444;
  --danger-soft: #fff0f0;
  --sidebar-width: 272px;
  --rail-width: 252px;
  --radius: 12px;
  --shadow-float: 0 14px 40px rgba(42, 50, 66, .14);
  --header-glass: color-mix(in srgb, #f7f8fa 88%, transparent);
  --dock-glass: color-mix(in srgb, #ffffff 91%, transparent);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1116;
  --surface: #171b22;
  --surface-subtle: #20262f;
  --surface-hover: #29313c;
  --text: #f1f4f8;
  --text-soft: #b4bdc9;
  --text-faint: #818c9a;
  --line: #2b323d;
  --line-strong: #3b4552;
  --accent: #86a9ff;
  --accent-strong: #a8c1ff;
  --accent-soft: #202c46;
  --action: #4e76d8;
  --danger: #ff9696;
  --danger-soft: #3a2428;
  --shadow-float: 0 18px 52px rgba(0, 0, 0, .48);
  --header-glass: color-mix(in srgb, #0e1116 86%, transparent);
  --dock-glass: color-mix(in srgb, #171b22 90%, transparent);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.library-body { touch-action: manipulation; overscroll-behavior-x: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
label { display: block; color: var(--text-soft); font-size: 13px; font-weight: 650; }
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
input, select { min-height: 42px; padding: 0 12px; }
input[type="search"] { appearance: none; -webkit-appearance: none; }
select {
  appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-faint) 50%),
    linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 1px),
    calc(100% - 13px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea { padding: 10px 12px; resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus, [contenteditable="true"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
input[type="checkbox"] {
  appearance: none;
  width: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  flex: 0 0 20px;
  background: var(--surface);
}
input[type="checkbox"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image:
    linear-gradient(45deg, transparent 46%, #fff 46%, #fff 58%, transparent 58%),
    linear-gradient(135deg, transparent 42%, #fff 42%, #fff 54%, transparent 54%);
  background-position: 4px 8px, 8px 6px;
  background-size: 7px 7px, 9px 9px;
  background-repeat: no-repeat;
}
input[type="file"] { padding: 5px; min-height: 46px; color: var(--text-soft); }
input[type="file"]::file-selector-button {
  height: 34px;
  margin-right: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
input[type="file"]::file-selector-button:hover { background: var(--surface-hover); }
input[type="file"]::file-selector-button:active { transform: scale(.97); }

.primary-button, .secondary-button, .quiet-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.primary-button { background: var(--action); color: #fff; }
.secondary-button { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.quiet-action { background: transparent; color: var(--text-soft); border-color: var(--line); }
.quiet-action.active { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.primary-button:active, .secondary-button:active, .quiet-action:active { transform: translateY(1px); }

.library-shell { min-height: 100dvh; }
.doc-sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  width: min(86vw, var(--sidebar-width));
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: var(--surface);
  transform: translateX(-102%);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto;
}
body.sidebar-open .doc-sidebar { transform: translateX(0); }
.sidebar-scrim {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  border: 0;
  background: rgba(18, 22, 28, .34);
  backdrop-filter: blur(2px);
}
body.sidebar-open .sidebar-scrim { display: block; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.library-brand, .admin-brand, .gate-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.library-brand > span:last-child, .admin-brand > span:last-child, .gate-brand > span:last-child { min-width: 0; }
.library-brand strong, .admin-brand strong, .gate-brand strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.3; }
.library-brand small, .admin-brand small, .gate-brand small { display: block; margin-top: 1px; color: var(--text-faint); font-size: 11px; }
.brand-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--action);
  color: #fff;
  font: 800 17px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.brand-logo { width: 34px; height: 34px; display: block; flex: 0 0 auto; border-radius: 9px; object-fit: cover; }
.sidebar-close { min-height: 34px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); color: var(--text-soft); font-size: 12px; }
.sidebar-search { margin: 22px 0 12px; }
.sidebar-search > label { margin: 0 0 6px 3px; font-size: 11px; }
.sidebar-search > div { position: relative; }
.sidebar-search input { margin: 0; padding-right: 46px; background: var(--page); }
.sidebar-search kbd { position: absolute; top: 13px; right: 10px; color: var(--text-faint); font: 11px/1 ui-monospace, monospace; }
.library-nav { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.library-nav a { padding: 8px 10px; border-radius: 8px; color: var(--text-soft); font-size: 13px; }
.library-nav a:hover, .library-nav a.active { background: var(--surface-subtle); color: var(--text); }
.library-nav a.active { font-weight: 700; }
.category-tree { padding: 15px 0; }
.tree-title { display: flex; justify-content: space-between; gap: 10px; padding: 0 9px 7px; color: var(--text-faint); font-size: 11px; }
.tree-node > a {
  min-height: 34px;
  display: block;
  padding: 6px 9px 6px calc(9px + var(--tree-depth) * 15px);
  border-radius: 7px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-node > a:hover, .tree-node > a.active { background: var(--surface-subtle); color: var(--text); }
.tree-node > a.active { font-weight: 700; color: var(--accent-strong); }
.sidebar-empty { margin: 4px 9px; color: var(--text-faint); font-size: 12px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-foot button { width: 100%; min-height: 34px; padding: 5px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text-faint); text-align: left; font-size: 12px; }
.sidebar-foot button:hover { background: var(--surface-subtle); color: var(--text); }
.sidebar-foot { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px; }
.sidebar-foot form { min-width: 0; }
.sidebar-foot .theme-icon-button { width: 40px; min-height: 38px; display: grid; place-items: center; padding: 0; text-align: center; }
.theme-icon-button .dock-icon { width: 20px; height: 20px; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
.mobile-doc-header {
  position: sticky;
  z-index: 35;
  top: 0;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  display: grid;
  grid-template-columns: 40px 1fr 48px;
  align-items: center;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: var(--header-glass);
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
}
.mobile-header-title { overflow: hidden; padding: 0 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; letter-spacing: -.015em; }
.mobile-header-action { width: 40px; height: 40px; display: grid; place-items: center; justify-self: end; border-radius: 11px; color: var(--accent-strong); }
.mobile-header-action .dock-icon, .mobile-back-button .dock-icon { width: 22px; height: 22px; }
.mobile-doc-header button { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; }
.mobile-doc-header button:active, .mobile-header-action:active { transform: scale(.92); background: var(--surface-subtle); }
.menu-lines, .menu-lines::before, .menu-lines::after { width: 19px; height: 1.5px; display: block; border-radius: 2px; background: var(--text); }
.menu-lines { position: relative; margin: auto; }
.menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
.menu-lines::before { top: -6px; }
.menu-lines::after { top: 6px; }
.doc-main { width: min(100%, 1120px); margin: 0 auto; padding: 26px 17px calc(102px + env(safe-area-inset-bottom)); }
.mobile-bottom-nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(70px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: var(--dock-glass);
  box-shadow: 0 -10px 32px color-mix(in srgb, var(--text) 7%, transparent);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  transition: transform .24s var(--ease-out), opacity .18s ease;
}
.mobile-bottom-nav a, .mobile-bottom-nav button {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: 32px 16px;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  transition: color .2s ease, background-color .2s ease, transform .16s ease;
}
.dock-icon {
  width: 23px;
  height: 23px;
  display: block;
  background-color: currentColor;
  -webkit-mask: var(--dock-icon) center / contain no-repeat;
  mask: var(--dock-icon) center / contain no-repeat;
  transition: transform .22s var(--ease-out);
}
.icon-folders { --dock-icon: url('/icons/ui/folders.svg'); }
.icon-home { --dock-icon: url('/icons/ui/home.svg'); }
.icon-arrow-left { --dock-icon: url('/icons/ui/arrow-left.svg'); }
.icon-search { --dock-icon: url('/icons/ui/search.svg'); }
.icon-notes { --dock-icon: url('/icons/ui/notes.svg'); }
.icon-file-text { --dock-icon: url('/icons/ui/file-text.svg'); }
.icon-category { --dock-icon: url('/icons/ui/category.svg'); }
.icon-settings { --dock-icon: url('/icons/ui/settings.svg'); }
.icon-folder { --dock-icon: url('/icons/ui/folder.svg'); }
.icon-chevron-right { --dock-icon: url('/icons/ui/chevron-right.svg'); }
.icon-sun { --dock-icon: url('/icons/ui/sun.svg'); }
.icon-moon { --dock-icon: url('/icons/ui/moon.svg'); }
.icon-pencil { --dock-icon: url('/icons/ui/pencil.svg'); }
.icon-highlight { --dock-icon: url('/icons/ui/highlight.svg'); }
.icon-star { --dock-icon: url('/icons/ui/star.svg'); }
.theme-icon-button .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-button .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-button .theme-icon-sun { display: block; }
.mobile-bottom-nav span { line-height: 1; }
.mobile-bottom-nav a:active, .mobile-bottom-nav button:active { transform: scale(.96); }
.dock-icon-shell { width: 42px; height: 30px; display: grid; place-items: center; border-radius: 11px; transition: background-color .2s ease, transform .2s var(--ease-out); }
.mobile-bottom-nav .active, .mobile-bottom-nav .is-active { color: var(--accent-strong); }
.mobile-bottom-nav .active .dock-icon-shell, .mobile-bottom-nav .is-active .dock-icon-shell { background: var(--accent-soft); transform: translateY(-1px); }
.mobile-bottom-nav .active .dock-icon, .mobile-bottom-nav .is-active .dock-icon { transform: scale(1.08); }
body.app-keyboard-open .mobile-bottom-nav, body.app-keyboard-open .admin-mobile-dock { transform: translateY(115%); opacity: 0; pointer-events: none; }

.home-document, .search-document, .category-document, .notes-document, .directory-document { max-width: 820px; margin: 0 auto; }
.document-home-head { padding: 14px 0 22px; }
.document-home-head > p { margin: 0 0 6px; color: var(--text-faint); font-size: 12px; }
.document-home-head h1, .page-title h1, .article-header h1 { margin: 0; letter-spacing: -.035em; line-height: 1.18; }
.document-home-head h1 { font-size: clamp(30px, 8vw, 46px); }
.home-search { margin-top: 24px; }
.home-search > label { display: block; margin-bottom: 7px; }
.home-search > div, .search-primary > div, .admin-search > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.home-search input, .search-primary input { min-height: 50px; margin: 0; background: var(--surface); font-size: 15px; }
.home-search button, .search-primary button, .admin-search button { min-width: 74px; border: 0; border-radius: 9px; background: var(--action); color: #fff; font-weight: 700; }
.document-section { margin-top: 34px; }
.plain-section-head { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.plain-section-head h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.plain-section-head > span { color: var(--text-faint); font-size: 12px; }
.plain-section-head > a { color: var(--accent-strong); font-size: 12px; }
.doc-list { border-top: 1px solid var(--line); }
.doc-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--line);
  transition: background-color .16s ease;
}
.doc-row:hover { background: var(--surface-subtle); }
.doc-file-mark { position: relative; width: 15px; height: 19px; border: 1.5px solid var(--text-faint); border-radius: 2px; }
.doc-file-mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 1px; background: var(--text-faint); box-shadow: 0 4px 0 var(--text-faint), 0 8px 0 var(--text-faint); opacity: .6; }
.doc-row-copy { min-width: 0; }
.doc-row-copy strong, .doc-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row-copy strong { font-size: 14px; }
.doc-row-copy small { margin-top: 2px; color: var(--text-soft); font-size: 12px; }
.doc-row-meta { display: grid; gap: 1px; color: var(--text-faint); text-align: right; font-size: 11px; }
.doc-row-meta time { font-variant-numeric: tabular-nums; }
.clean-empty { padding: 48px 20px; text-align: center; color: var(--text-soft); }
.clean-empty.compact { padding: 28px 16px; }
.clean-empty strong { display: block; margin-top: 10px; color: var(--text); font-size: 16px; }
.clean-empty p { margin: 5px auto 0; max-width: 36ch; font-size: 13px; }
.empty-sheet { position: relative; width: 32px; height: 40px; display: inline-block; border: 1.5px solid var(--line-strong); border-radius: 4px; background: var(--surface); }
.empty-sheet::after { content: ""; position: absolute; left: 7px; right: 7px; top: 11px; height: 1px; background: var(--line-strong); box-shadow: 0 6px 0 var(--line-strong), 0 12px 0 var(--line-strong); }
.empty-search { position: relative; width: 29px; height: 29px; display: inline-block; border: 2px solid var(--line-strong); border-radius: 50%; }
.empty-search::after { content: ""; position: absolute; width: 12px; height: 2px; right: -8px; bottom: -4px; transform: rotate(45deg); background: var(--line-strong); }
.page-title { padding: 8px 0 18px; }
.page-title h1 { font-size: clamp(30px, 7vw, 42px); }
.page-title > p { margin: 7px 0 0; color: var(--text-soft); }
.directory-page-title, .notes-page-title { padding-bottom: 22px; }
.directory-filter { margin-bottom: 22px; }
.directory-filter > span { display: block; margin: 0 0 7px 2px; }
.directory-filter > div { position: relative; }
.directory-filter .dock-icon { position: absolute; z-index: 1; top: 50%; left: 13px; width: 19px; height: 19px; transform: translateY(-50%); color: var(--text-faint); }
.directory-filter input { min-height: 48px; margin: 0; padding-left: 43px; background: var(--surface); }
.directory-list { display: grid; gap: 12px; }
.directory-node[hidden] { display: none !important; }
.directory-branch > summary { list-style: none; cursor: pointer; }
.directory-branch > summary::-webkit-details-marker { display: none; }
.directory-root { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.directory-root > .directory-row { min-height: 64px; background: var(--surface-subtle); }
.directory-root > .directory-row .directory-row-copy strong { font-size: 15px; }
.directory-root > .directory-row > .dock-icon:first-child { color: var(--accent-strong); }
.directory-children { margin-left: 20px; border-left: 1px solid var(--line); }
.directory-children .directory-children { margin-left: 18px; }
.directory-row {
  min-height: 60px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  transition: background-color .18s ease, color .18s ease;
}
.directory-row:hover { background: var(--surface-subtle); color: var(--accent-strong); }
.directory-row > .dock-icon:first-child { width: 21px; height: 21px; color: var(--text-faint); }
.directory-row:hover > .dock-icon:first-child { color: var(--accent-strong); }
.directory-row-copy { min-width: 0; color: inherit; }
.directory-row-copy strong, .directory-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-row-copy strong { color: var(--text); font-size: 14px; }
.directory-row-copy small { margin-top: 1px; color: var(--text-faint); font-size: 11px; }
.directory-chevron { width: 16px; height: 16px; color: var(--text-faint); transition: transform .18s var(--ease-out); }
.directory-row:hover .directory-chevron { transform: translateX(2px); color: var(--accent-strong); }
.directory-branch[open] > .directory-row .directory-chevron { transform: rotate(90deg); color: var(--accent-strong); }
.directory-branch:not([open]) > .directory-row { border-bottom-color: transparent; }
.directory-empty, .directory-no-result { border-bottom: 1px solid var(--line); }
.directory-empty > .dock-icon, .directory-no-result > .dock-icon, .notes-empty > .dock-icon { width: 30px; height: 30px; margin: 0 auto; color: var(--line-strong); }

.notes-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.notes-overview a { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 13px 14px; transition: background-color .18s ease, color .18s ease; }
.notes-overview a + a { border-left: 1px solid var(--line); }
.notes-overview a:hover { background: var(--surface-subtle); color: var(--accent-strong); }
.notes-overview .dock-icon { width: 21px; height: 21px; flex: 0 0 auto; color: var(--accent-strong); }
.notes-overview span, .notes-overview strong, .notes-overview small { display: block; min-width: 0; }
.notes-overview strong { font-size: 17px; line-height: 1.1; }
.notes-overview small { margin-top: 2px; color: var(--text-faint); font-size: 10px; white-space: nowrap; }
.notes-section { margin-top: 40px; scroll-margin-top: 76px; }
.notes-section-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-bottom: 12px; }
.notes-section-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); }
.notes-section-icon .dock-icon { width: 20px; height: 20px; }
.notes-section-head h2, .notes-section-head p { margin: 0; }
.notes-section-head h2 { font-size: 17px; line-height: 1.3; }
.notes-section-head p { margin-top: 2px; color: var(--text-faint); font-size: 11px; }
.notes-section-head > span:last-child { color: var(--text-faint); font-size: 11px; }
.learning-note-list { border-top: 1px solid var(--line); }
.learning-note-row {
  --note-color: var(--accent);
  min-width: 0;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 13px;
  padding: 15px 8px 15px 4px;
  border-bottom: 1px solid var(--line);
  transition: background-color .18s ease;
}
.learning-note-row:hover { background: var(--surface-subtle); }
.note-color-line { width: 4px; height: 44px; border-radius: 4px; background: var(--note-color); }
.learning-note-main { min-width: 0; }
.learning-note-title { display: flex; align-items: center; gap: 8px; }
.learning-note-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.learning-note-title em { flex: 0 0 auto; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--note-color) 15%, var(--surface)); color: var(--text-soft); font-size: 10px; font-style: normal; font-weight: 700; }
.learning-note-content { margin-top: 5px; display: -webkit-box; overflow: hidden; color: var(--text-soft); font-size: 13px; line-height: 1.55; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.learning-note-meta { margin-top: 7px; display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 10px; }
.learning-note-meta time { margin-left: auto; font-variant-numeric: tabular-nums; }
.learning-note-row > .dock-icon { width: 16px; height: 16px; color: var(--text-faint); }
.highlight-note-list { display: grid; gap: 10px; }
.highlight-note-row {
  --note-color: var(--accent);
  display: block;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--note-color);
  border-radius: 9px;
  background: var(--surface);
  transition: border-color .18s ease, transform .18s ease;
}
.highlight-note-row:hover { border-color: color-mix(in srgb, var(--note-color) 45%, var(--line)); transform: translateY(-1px); }
.highlight-note-row blockquote { margin: 0; color: var(--text); font-size: 14px; font-weight: 650; line-height: 1.65; }
.highlight-note-row > p { margin: 11px 0 0; padding: 10px 12px; border-radius: 7px; background: color-mix(in srgb, var(--note-color) 9%, var(--surface-subtle)); color: var(--text-soft); font-size: 12px; white-space: pre-wrap; }
.highlight-note-row > p strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 10px; }
.highlight-note-source { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.highlight-note-source span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-strong); font-size: 11px; }
.highlight-note-source small { flex: 0 0 auto; color: var(--text-faint); font-size: 10px; }
.note-accent-yellow { --note-color: #d2a51e; }
.note-accent-red { --note-color: #cf5b5b; }
.note-accent-green { --note-color: #4b9b67; }
.note-accent-blue { --note-color: #4f81c5; }
.favorite-document-list { margin-top: 3px; }
.notes-empty { width: 100%; }
.notes-search { margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notes-search > label { margin-bottom: 7px; }
.notes-search > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
.notes-search input { margin: 0; min-width: 0; background: var(--page); }
.notes-search .primary-button, .notes-search .secondary-button { min-height: 42px; }
.notes-group-list { display: grid; gap: 10px; }
.notes-source-group { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notes-source-group > summary { min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 11px 14px; list-style: none; cursor: pointer; transition: background-color .18s ease; }
.notes-source-group > summary::-webkit-details-marker, .managed-record-editor > summary::-webkit-details-marker { display: none; }
.notes-source-group > summary:hover { background: var(--surface-subtle); }
.notes-source-copy, .notes-source-copy strong, .notes-source-copy small { min-width: 0; display: block; }
.notes-source-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.notes-source-copy small { margin-top: 2px; color: var(--text-faint); font-size: 10px; }
.notes-source-count { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.notes-source-group > summary .dock-icon { width: 16px; height: 16px; color: var(--text-faint); transition: transform .18s var(--ease-out); }
.notes-source-group[open] > summary { background: var(--surface-subtle); }
.notes-source-group[open] > summary .dock-icon { transform: rotate(90deg); }
.notes-source-items { display: grid; gap: 9px; padding: 10px; border-top: 1px solid var(--line); }
.managed-note-record, .managed-annotation-record { --note-color: var(--accent); padding: 13px 14px; border-left: 4px solid var(--note-color); border-radius: 8px; background: color-mix(in srgb, var(--note-color) 8%, var(--surface)); }
.managed-record-copy p, .managed-annotation-record blockquote, .managed-annotation-record > p { margin: 0; white-space: pre-wrap; }
.managed-record-copy p { color: var(--text); font-size: 13px; line-height: 1.65; }
.managed-record-copy small, .managed-annotation-record > small { margin-top: 7px; display: block; color: var(--text-faint); font-size: 10px; }
.managed-record-copy small strong { margin-right: 6px; color: var(--note-color); }
.managed-annotation-record blockquote { color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.65; }
.managed-annotation-record > p { margin-top: 9px; padding: 9px 10px; border-radius: 7px; background: color-mix(in srgb, var(--note-color) 9%, var(--surface)); color: var(--text-soft); font-size: 12px; line-height: 1.6; }
.managed-annotation-record > p strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 10px; }
.managed-record-actions { margin-top: 11px; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 7px; }
.managed-record-actions > a, .managed-record-editor > summary, .managed-delete-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-soft); font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.managed-record-actions > a:hover, .managed-record-editor > summary:hover { border-color: var(--line-strong); color: var(--accent-strong); }
.managed-delete-button { color: var(--danger); cursor: pointer; }
.managed-record-editor { flex: 0 0 auto; }
.managed-record-editor[open] { flex: 1 0 100%; }
.managed-record-editor > summary { width: fit-content; list-style: none; cursor: pointer; }
.managed-record-editor[open] > summary { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }
.managed-record-editor > form { margin-top: 9px; padding: 13px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.managed-record-editor textarea { background: var(--page); }
.managed-record-editor .primary-button { width: 100%; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.search-workbench { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.search-filters { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search-results { margin-top: 26px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; color: var(--text-faint); font-size: 12px; }
.breadcrumb a:hover { color: var(--accent-strong); }
.subcategories { margin-top: 12px; }
.subcategories h2 { margin: 0 0 8px; font-size: 15px; }
.subcategories > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.subcategories a { padding: 11px 12px; display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.subcategories small { color: var(--text-faint); }

.article-layout { max-width: 1040px; margin: 0 auto; }
.document-reader { min-width: 0; }
.article-header { padding: 3px 0 24px; border-bottom: 1px solid var(--line); }
.article-header h1 { font-size: clamp(32px, 8vw, 52px); }
.article-summary { margin: 11px 0 0; max-width: 66ch; color: var(--text-soft); font-size: 16px; }
.article-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--text-faint); font-size: 12px; }
.tag-line { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-line span { color: var(--accent-strong); font-size: 12px; }
.article-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 7px; }
.article-actions form { display: contents; }
.article-cover { width: 100%; max-height: 480px; margin: 24px 0 0; object-fit: cover; border-radius: var(--radius); }
.article-content { padding: 20px 0 34px; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.article-content > *:first-child { margin-top: 0; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4 { scroll-margin-top: 76px; margin: 1.8em 0 .65em; line-height: 1.32; letter-spacing: -.02em; }
.article-content h1 { font-size: 28px; }
.article-content h2 { font-size: 24px; }
.article-content h3 { font-size: 20px; }
.article-content h4 { font-size: 17px; }
.article-content p { margin: 1em 0; }
.m5e-quick { margin: 0 0 20px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.m5e-quick > h2 { margin: 0 0 5px; font-size: 18px; }
.m5e-quick-tip { margin: 0 0 6px !important; color: var(--text-soft); font-size: 14px; line-height: 1.6; }
.m5e-memory-sentence { margin: 7px 0 0 !important; font-size: 16px; font-weight: 800; line-height: 2.25; }
.m5e-memory-sentence strong { display: inline-block; margin: 2px 1px; padding: 1px 6px; border-bottom: 2px solid var(--m5e-color); border-radius: 7px; background: color-mix(in srgb, var(--m5e-color) 9%, var(--surface)); color: var(--m5e-color); white-space: nowrap; }
.m5e-quick-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0 7px; }
.m5e-quick-table th, .m5e-quick-table td { border: 0; background: color-mix(in srgb, var(--m5e-color) 8%, var(--surface)); }
.m5e-quick-table th { width: 48px; padding: 9px 8px; border-left: 4px solid var(--m5e-color); border-radius: 9px 0 0 9px; color: var(--m5e-color); font-size: 17px; text-align: center; }
.m5e-quick-table td { padding: 9px 10px; border-radius: 0 9px 9px 0; font-size: 14px; font-weight: 700; line-height: 1.55; }
.article-content.m5e-content > p.m5e-intro { margin: 0 0 18px; padding: 11px 14px; border-radius: 10px; background: var(--surface-subtle); color: var(--text-soft); font-weight: 750; letter-spacing: .08em; }
.m5e-section { --m5e-color: var(--accent); margin: 14px 0; padding: 0 14px 10px; border-left: 4px solid var(--m5e-color); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--m5e-color) 7%, var(--surface)); }
.m5e-section h2 { margin: 0 -14px 8px 0; padding: 9px 12px; border-bottom: 1px solid color-mix(in srgb, var(--m5e-color) 22%, var(--line)); border-radius: 0 9px 0 0; background: color-mix(in srgb, var(--m5e-color) 12%, var(--surface)); color: var(--m5e-color); font-size: 16px; letter-spacing: 0; }
.m5e-section p { margin: 7px 0; line-height: 1.65; }
.m5e-person { --m5e-color: #3f76be; }
.m5e-machine { --m5e-color: #8464bd; }
.m5e-material { --m5e-color: #c27a2c; }
.m5e-method { --m5e-color: #438d5d; }
.m5e-environment { --m5e-color: #258c88; }
.m5e-measure { --m5e-color: #c05656; }
.prohibition-section { --prohibition-color: #b45b5b; margin: 14px 0; padding: 0 15px 14px; border-left: 4px solid var(--prohibition-color); border-radius: 0 11px 11px 0; background: color-mix(in srgb, var(--prohibition-color) 7%, var(--surface)); }
.prohibition-section h2 { margin: 0 -15px 9px 0; padding: 10px 13px; border-bottom: 1px solid color-mix(in srgb, var(--prohibition-color) 22%, var(--line)); border-radius: 0 10px 0 0; background: color-mix(in srgb, var(--prohibition-color) 12%, var(--surface)); color: var(--prohibition-color); font-size: 17px; letter-spacing: 0; }
.prohibition-section p { margin: 9px 0 0; font-size: 16px; font-weight: 750; line-height: 1.7; }
.prohibition-lockout { --prohibition-color: #bd5555; }
.prohibition-device { --prohibition-color: #bd7a2d; }
.prohibition-teamwork { --prohibition-color: #4779b9; }
.study-quick { margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.study-quick > h2 { margin: 0 0 6px; font-size: 18px; }
.study-memory-sentence { margin: 0 !important; font-size: 16px; font-weight: 800; line-height: 2.25; }
.study-memory-sentence strong { --study-color: #4879b9; display: inline-block; margin: 2px 1px; padding: 1px 7px; border-bottom: 2px solid var(--study-color); border-radius: 7px; background: color-mix(in srgb, var(--study-color) 9%, var(--surface)); color: var(--study-color); white-space: nowrap; }
.study-section { --study-color: #4879b9; margin: 14px 0; padding: 0 15px 14px; border-left: 4px solid var(--study-color); border-radius: 0 11px 11px 0; background: color-mix(in srgb, var(--study-color) 7%, var(--surface)); }
.study-section h2 { margin: 0 -15px 9px 0; padding: 10px 13px; border-bottom: 1px solid color-mix(in srgb, var(--study-color) 22%, var(--line)); border-radius: 0 10px 0 0; background: color-mix(in srgb, var(--study-color) 12%, var(--surface)); color: var(--study-color); font-size: 17px; letter-spacing: 0; }
.study-section p { margin: 9px 0 0; font-size: 16px; font-weight: 700; line-height: 1.7; }
.study-tone-1 { --study-color: #4779b9 !important; }
.study-tone-2 { --study-color: #8664b6 !important; }
.study-tone-3 { --study-color: #bd7a2d !important; }
.study-tone-4 { --study-color: #42885b !important; }
.study-tone-5 { --study-color: #278985 !important; }
.study-tone-6 { --study-color: #bd5555 !important; }
.study-group-title { margin: 22px 0 9px !important; font-size: 18px !important; letter-spacing: 0 !important; }
.study-line { --study-color: #4879b9; margin: 8px 0 !important; padding: 10px 13px; border-left: 4px solid var(--study-color); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--study-color) 8%, var(--surface)); font-size: 16px; font-weight: 720; line-height: 1.65; }
.article-content ul, .article-content ol { padding-left: 1.4em; }
.article-content li { margin: .4em 0; }
.article-content a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.article-content blockquote { margin: 20px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text-soft); }
.article-content blockquote p { margin: 0; }
.article-content code { padding: 2px 5px; border-radius: 5px; background: var(--surface-subtle); color: var(--accent-strong); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-content pre { overflow-x: auto; margin: 22px 0; padding: 17px; border-radius: 10px; background: #20242b; color: #eef1f5; line-height: 1.7; }
.article-content pre code { padding: 0; background: transparent; color: inherit; }
.article-content table { width: 100%; margin: 20px 0; border-collapse: collapse; font-size: 14px; }
.article-content th, .article-content td { padding: 9px 10px; border: 1px solid var(--line); text-align: left; }
.article-content img { max-height: 620px; margin: 20px auto; border-radius: 8px; object-fit: contain; }
.article-highlight { padding: .08em .02em; border-radius: 2px; background: transparent; color: inherit; cursor: pointer; scroll-margin-top: 90px; text-decoration-line: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
.article-highlight.is-focused { outline: 2px solid var(--accent); outline-offset: 2px; }
.highlight-yellow { text-decoration-color: #d2a51e; }
.highlight-red { text-decoration-color: #cf5b5b; }
.highlight-green { text-decoration-color: #4b9b67; }
.highlight-blue { text-decoration-color: #4f81c5; }
.article-inline-annotation { margin-left: 6px; color: var(--text-soft); font-size: 11px; font-weight: 500; line-height: 1.45; white-space: pre-wrap; cursor: pointer; }
.article-inline-annotation::before { content: "注："; color: var(--annotation-color); font-weight: 750; }
.inline-annotation-yellow { --annotation-color: #b58b13; }
.inline-annotation-red { --annotation-color: #bd4a4a; }
.inline-annotation-green { --annotation-color: #3f8959; }
.inline-annotation-blue { --annotation-color: #3e70b3; }
.article-inline-annotation.is-focused { border-radius: 3px; outline: 2px solid var(--accent); outline-offset: 2px; }
.article-attachments, .article-note-area, .article-related { padding: 28px 0; border-top: 1px solid var(--line); }
.article-attachments h2, .article-related h2 { margin: 0 0 10px; font-size: 17px; }
.article-attachments > a { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; color: var(--accent-strong); }
.article-attachments small { color: var(--text-faint); }
.inline-note-form { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.inline-note-form textarea { background: var(--page); }
.note-add-button { min-height: 34px; padding: 5px 10px; gap: 6px; font-size: 12px; }
.note-add-button .dock-icon { width: 16px; height: 16px; }
.article-note-empty { border-top: 1px solid var(--line); }
.article-note-empty > .dock-icon { width: 28px; height: 28px; margin: 0 auto; color: var(--line-strong); }
.note-form-options { margin-top: 10px; display: grid; grid-template-columns: 1fr; gap: 10px; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--text-soft); }
.check-row input { width: 18px; height: 18px; min-height: auto; margin: 0; accent-color: var(--accent); }
.note-list, .annotation-library-list { margin-top: 11px; display: grid; gap: 9px; }
.note-item, .annotation-library-item { display: block; padding: 13px 14px; border: 1px solid transparent; border-radius: 9px; }
.note-item p, .annotation-library-item p { margin: 5px 0; white-space: pre-wrap; }
.note-item strong, .note-item small, .note-item time, .annotation-library-item strong, .annotation-library-item small, .annotation-library-item span { display: block; }
.note-item small, .note-item time, .annotation-library-item small, .annotation-library-item span { color: var(--text-soft); font-size: 11px; }
.note-item > div { display: flex; justify-content: space-between; gap: 12px; }
.note-item form button { border: 0; background: transparent; color: var(--danger); font-size: 12px; }
.note-yellow { background: color-mix(in srgb, #f2c94c 15%, var(--surface)); border-color: color-mix(in srgb, #d5a919 25%, var(--line)); }
.note-red { background: color-mix(in srgb, #eb6a6a 12%, var(--surface)); border-color: color-mix(in srgb, #cf5050 24%, var(--line)); }
.note-green { background: color-mix(in srgb, #58b77b 13%, var(--surface)); border-color: color-mix(in srgb, #439b63 24%, var(--line)); }
.note-blue { background: color-mix(in srgb, #5b92dc 12%, var(--surface)); border-color: color-mix(in srgb, #3f76be 24%, var(--line)); }
.related-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.related-row small { color: var(--text-faint); }
.article-rail { display: none; }
.article-rail section + section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.article-rail h2 { margin: 0 0 9px; font-size: 12px; color: var(--text-soft); }
.article-toc { display: grid; gap: 1px; }
.article-toc a { padding: 5px 7px; border-radius: 6px; overflow: hidden; color: var(--text-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.article-toc a.level-3 { padding-left: 18px; }
.article-toc a.active, .article-toc a:hover { background: var(--surface-subtle); color: var(--accent-strong); }
.article-toc p, .rail-help, .rail-empty { margin: 0; color: var(--text-faint); font-size: 11px; }
.rail-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rail-title span { color: var(--text-faint); font-size: 11px; }
.annotation-rail-list { margin-top: 10px; display: grid; gap: 6px; }
.annotation-preview { width: 100%; padding: 9px; border: 1px solid transparent; border-radius: 7px; color: var(--text); text-align: left; }
.annotation-preview strong, .annotation-preview span { display: block; font-size: 11px; line-height: 1.45; }
.annotation-preview span { margin-top: 3px; color: var(--text-soft); }
.annotation-preview.is-focused { border-color: var(--accent); }
.selection-toolbar { position: fixed; z-index: 80; min-width: 176px; min-height: 46px; padding: 7px 12px; border: 0; border-radius: 10px; display: flex; align-items: center; gap: 9px; background: #20242c; color: #fff; box-shadow: var(--shadow-float); text-align: left; }
.selection-toolbar[hidden] { display: none; }
.selection-toolbar .dock-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.selection-toolbar span, .selection-toolbar strong, .selection-toolbar small { display: block; }
.selection-toolbar strong { font-size: 12px; line-height: 1.35; }
.selection-toolbar small { margin-top: 1px; color: rgba(255, 255, 255, .7); font-size: 10px; line-height: 1.3; font-weight: 500; }
.annotation-dialog, .ui-dialog { width: min(94vw, 540px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
.annotation-dialog::backdrop { background: rgba(18, 22, 28, .42); backdrop-filter: blur(3px); }
.annotation-dialog form { padding: 20px; display: grid; gap: 14px; }
.note-dialog textarea { background: var(--page); }
.note-review-option { min-height: 48px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); }
.note-review-option span, .note-review-option strong, .note-review-option small { display: block; }
.note-review-option strong { color: var(--text); font-size: 12px; }
.note-review-option small { margin-top: 1px; color: var(--text-faint); font-size: 10px; font-weight: 400; }
.dialog-save-button { width: 100%; min-height: 44px; }
.annotation-dialog[open], .ui-dialog[open] { animation: dialog-in .22s var(--ease-out) both; }
.annotation-dialog.is-closing, .ui-dialog.is-closing { animation: dialog-out .15s ease both; }
.annotation-dialog::backdrop, .ui-dialog::backdrop { animation: dialog-backdrop-in .18s ease both; background: rgba(18, 22, 28, .42); backdrop-filter: blur(3px); }
.ui-dialog { max-width: 430px; }
.ui-dialog-form { padding: 20px; display: grid; gap: 16px; }
.ui-dialog-copy { display: grid; gap: 4px; }
.ui-dialog-copy strong { font-size: 17px; line-height: 1.35; }
.ui-dialog-copy p { margin: 0; color: var(--text-soft); font-size: 13px; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ui-dialog-actions button { min-width: 76px; }
.dialog-head { display: flex; justify-content: space-between; gap: 18px; }
.dialog-head strong, .dialog-head small { display: block; }
.dialog-head small { margin-top: 2px; color: var(--text-faint); }
.dialog-head button { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); color: var(--text-soft); font-size: 12px; }
.color-field { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; border: 0; }
.color-field legend { margin-bottom: 7px; color: var(--text-soft); font-size: 13px; font-weight: 650; }
.color-field input { position: absolute; opacity: 0; pointer-events: none; }
.color-field span { min-height: 38px; display: grid; place-items: center; border: 2px solid transparent; border-radius: 8px; color: #27303c; font-size: 12px; }
.color-field input:checked + span { border-color: var(--accent); }
.color-yellow { background: #f7e6a8; }
.color-red { background: #f2b1b1; }
.color-green { background: #b9e2c8; }
.color-blue { background: #b9d2ef; }

.pagination { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 5px; }
.pagination > * { min-width: 36px; min-height: 36px; display: grid; place-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.toast { position: fixed; z-index: 100; top: calc(66px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 9px 13px; border-radius: 8px; background: #20242c; color: #fff; box-shadow: var(--shadow-float); font-size: 12px; font-weight: 700; animation: toast-in .22s both; }
.toast.is-leaving { animation: toast-out .2s ease both; }
.install-hint { position: fixed; z-index: 90; left: 14px; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); padding: 15px 78px 15px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-float); }
.install-hint strong { display: block; }
.install-hint p { margin: 3px 0 0; color: var(--text-soft); font-size: 12px; }
.install-hint button { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: var(--text-faint); font-size: 12px; }

.gate-page { min-height: 100dvh; display: grid; place-items: center; padding: 22px; background: var(--page); }
.gate-panel { width: min(100%, 430px); padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 50px rgba(42, 50, 66, .09); }
.gate-copy { margin: 45px 0 22px; }
.gate-copy h1 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.035em; }
.gate-copy p { margin: 6px 0 0; color: var(--text-soft); }
.stack-form { display: grid; gap: 13px; }
.stack-form .primary-button { width: 100%; margin-top: 3px; }
.form-error { margin: -5px 0 0; color: var(--danger); font-size: 12px; }

.admin-body { background: var(--page); }
.admin-shell { min-height: 100dvh; }
.admin-sidebar { display: none; }
.admin-mobile-head { position: sticky; z-index: 30; top: 0; height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 15px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.admin-mobile-head a { display: flex; align-items: center; gap: 10px; }
.admin-mobile-head button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-subtle); color: var(--text); }
.admin-main { width: min(100%, 1240px); margin: 0 auto; padding: 24px 16px calc(96px + env(safe-area-inset-bottom)); }
.admin-mobile-dock {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(70px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: var(--dock-glass);
  box-shadow: 0 -10px 32px color-mix(in srgb, var(--text) 7%, transparent);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  transition: transform .24s var(--ease-out), opacity .18s ease;
}
.admin-mobile-dock a {
  position: relative;
  display: grid;
  grid-template-rows: 32px 16px;
  place-items: center;
  align-content: center;
  gap: 1px;
  border-radius: 12px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
  transition: color .2s ease, background-color .2s ease, transform .16s ease;
}
.admin-mobile-dock .dock-icon { transition: transform .22s var(--ease-out); }
.admin-mobile-dock span { line-height: 1; }
.admin-mobile-dock a:active { transform: scale(.96); }
.admin-mobile-dock a.active { color: var(--accent-strong); }
.admin-mobile-dock a.active .dock-icon-shell { background: var(--accent-soft); transform: translateY(-1px); }
.admin-mobile-dock a.active .dock-icon { transform: scale(1.08); }
.admin-page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-page-head h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.03em; }
.admin-page-head p { margin: 5px 0 0; color: var(--text-soft); }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--accent-strong); font-size: 12px; }
.autosave-state { flex: 0 0 auto; color: var(--text-faint); font-size: 12px; }
.admin-search { max-width: 540px; margin-bottom: 16px; }
.admin-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.admin-table-head, .admin-table-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 80px 130px; gap: 16px; align-items: center; }
.admin-table-head { padding: 9px 14px; background: var(--surface-subtle); color: var(--text-faint); font-size: 11px; }
.admin-table-row { min-height: 66px; padding: 10px 14px; border-top: 1px solid var(--line); }
.admin-table-row:hover { background: var(--surface-subtle); }
.admin-table-row > span:first-child { min-width: 0; }
.admin-table-row strong, .admin-table-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table-row small, .admin-table-row time { color: var(--text-faint); font-size: 11px; }
.admin-table-row em { display: block; font-style: normal; font-size: 12px; }
.status-published { color: #39794f; }
.status-draft { color: var(--text-faint); }
.admin-empty { padding: 42px 20px; text-align: center; }
.admin-empty.prominent { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-empty strong { display: block; font-size: 16px; }
.admin-empty p { margin: 5px 0 14px; color: var(--text-soft); }
.admin-panel { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-panel > h2, .panel-head h2 { margin: 0; font-size: 17px; }
.panel-head { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head span { color: var(--text-faint); font-size: 11px; }
.category-form { margin-top: 14px; display: grid; gap: 11px; }
.category-manage-list { display: grid; gap: 10px; }
.category-manage-item { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--page); }
.category-manage-item > form { display: grid; gap: 10px; }
.category-manage-meta { margin-top: 11px; padding-top: 10px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--text-faint); font-size: 11px; }
.category-manage-meta button, .attachment-admin-list button, .version-list button { border: 0; background: transparent; color: var(--danger); font-size: 11px; }
.settings-form { max-width: 600px; display: grid; gap: 15px; }
.setting-divider { margin-top: 9px; padding-top: 17px; border-top: 1px solid var(--line); }
.setting-divider strong { display: block; }
.setting-divider p { margin: 3px 0 0; color: var(--text-soft); font-size: 12px; }
.logo-setting { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 14px; }
.logo-setting-preview { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-subtle); }
.logo-setting-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-setting-preview .brand-symbol { width: 46px; height: 46px; border-radius: 12px; font-size: 21px; }
.logo-setting label small { display: block; margin-top: 5px; color: var(--text-faint); font-size: 11px; font-weight: 400; }

/* Face ID / Passkey */
.face-id-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url('/icons/ui/face-id.svg') center / contain no-repeat;
  mask: url('/icons/ui/face-id.svg') center / contain no-repeat;
}
.passkey-login-button {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 14px;
  background: linear-gradient(135deg, var(--action), color-mix(in srgb, var(--action) 72%, #7a8fe8));
  color: #fff;
  text-align: left;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--action) 22%, transparent);
  transition: transform .18s var(--ease-out), box-shadow .18s ease, filter .18s ease;
}
.passkey-login-button > .face-id-icon { width: 32px; height: 32px; }
.passkey-login-button > span { display: grid; line-height: 1.3; }
.passkey-login-button strong { font-size: 15px; }
.passkey-login-button small { margin-top: 4px; color: rgba(255,255,255,.78); font-size: 11px; }
.passkey-login-button:active { transform: scale(.985); box-shadow: 0 6px 16px color-mix(in srgb, var(--action) 18%, transparent); }
.passkey-login-button:disabled { cursor: wait; filter: saturate(.72); }
.gate-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--text-faint); font-size: 11px; }
.gate-divider::before, .gate-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.passkey-spinner { width: 25px; height: 25px; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: passkey-spin .8s linear infinite; }
@keyframes passkey-spin { to { transform: rotate(360deg); } }

.passkey-settings { max-width: 760px; margin-top: 18px; }
.passkey-settings-head { display: flex; align-items: flex-start; gap: 13px; }
.passkey-settings-head h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.passkey-settings-head p { margin: 4px 0 0; color: var(--text-soft); font-size: 12px; }
.passkey-settings-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.passkey-settings-icon .face-id-icon { width: 27px; height: 27px; }
.passkey-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.passkey-scope-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-subtle); }
.passkey-scope-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.passkey-scope-title > div { min-width: 0; }
.passkey-scope-title strong { display: block; color: var(--text); font-size: 14px; }
.passkey-scope-title small { display: block; margin-top: 2px; color: var(--text-faint); font-size: 11px; font-weight: 400; }
.passkey-scope-title > span { padding: 3px 7px; border-radius: 999px; background: var(--surface); color: var(--text-soft); font-size: 10px; white-space: nowrap; }
.passkey-bind-button { width: 100%; margin-top: 13px; gap: 8px; background: var(--surface); }
.passkey-bind-button .face-id-icon { width: 19px; height: 19px; color: var(--accent-strong); }
.passkey-device-list { display: grid; gap: 7px; margin-top: 12px; }
.passkey-device { min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.passkey-device-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); }
.passkey-device-mark .face-id-icon { width: 19px; height: 19px; }
.passkey-device > span:nth-child(2) { min-width: 0; }
.passkey-device strong, .passkey-device small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passkey-device strong { font-size: 12px; }
.passkey-device small { margin-top: 1px; color: var(--text-faint); font-size: 10px; }
.passkey-device button { padding: 4px 6px; border: 0; background: transparent; color: var(--danger); font-size: 11px; font-weight: 650; }
.passkey-empty { margin: 0; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--text-faint); font-size: 11px; text-align: center; }
.passkey-footnote { margin: 14px 0 0; color: var(--text-faint); font-size: 11px; }

@media (max-width: 699px) {
  .gate-panel { padding: 22px; }
  .gate-copy { margin: 32px 0 18px; }
  .passkey-scope-grid { grid-template-columns: 1fr; }
  .passkey-settings { margin-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
.form-error-panel { margin-bottom: 16px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); border-radius: 9px; background: var(--danger-soft); color: var(--danger); }
.form-error-panel ul { margin: 6px 0 0; padding-left: 18px; }

.article-editor-form { display: grid; gap: 16px; }
.editor-main-column { min-width: 0; }
.editor-title-block { display: grid; gap: 5px; margin-bottom: 12px; }
.title-input, .summary-input { margin: 0; border-color: transparent; background: transparent; box-shadow: none !important; }
.title-input { min-height: 56px; padding: 4px 0; border-radius: 0; font-size: clamp(27px, 6vw, 38px); font-weight: 750; letter-spacing: -.035em; }
.summary-input { padding: 5px 0; color: var(--text-soft); }
.rich-editor-shell { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.rich-toolbar { position: sticky; z-index: 10; top: calc(58px + env(safe-area-inset-top)); display: flex; flex-wrap: wrap; gap: 4px; padding: 7px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.rich-toolbar button, .rich-toolbar select { width: auto; min-height: 34px; margin: 0; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 12px; }
.rich-toolbar select { padding-right: 30px; }
.rich-editor { min-height: 520px; padding: 26px 22px; outline: none; font-size: 16px; line-height: 1.8; }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--text-faint); }
.rich-editor h2, .rich-editor h3 { margin: 1.5em 0 .6em; }
.rich-editor blockquote { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.rich-editor pre { padding: 15px; border-radius: 9px; background: #20242b; color: #eef1f5; white-space: pre-wrap; }
.rich-editor img { max-height: 500px; margin: 18px auto; object-fit: contain; }
.editor-settings { display: grid; align-content: start; gap: 11px; }
.editor-side-panel { padding: 14px; display: grid; gap: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.editor-side-panel h2 { margin: 0 0 2px; font-size: 14px; }
.cover-preview { margin-top: 8px; max-height: 170px; border-radius: 8px; object-fit: cover; }
.editor-save { width: 100%; min-height: 46px; }
.editor-lower-grid { display: grid; gap: 0; }
.attachment-upload { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; }
.attachment-admin-list, .version-list { margin-top: 12px; display: grid; }
.attachment-admin-list > div, .version-list > div { min-height: 42px; padding: 7px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.attachment-admin-list a { color: var(--accent-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-list strong, .version-list small { display: block; }
.version-list strong { font-size: 12px; }
.version-list small { color: var(--text-faint); font-size: 10px; }
.danger-zone { margin-top: 16px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: var(--radius); background: var(--danger-soft); }
.danger-zone strong { display: block; }
.danger-zone p { margin: 2px 0 0; color: var(--text-soft); font-size: 11px; }
.danger-zone > button { border: 0; background: transparent; color: var(--danger); font-weight: 700; }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -7px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes toast-out { from { opacity: 1; transform: translate(-50%, 0) scale(1); } to { opacity: 0; transform: translate(-50%, -5px) scale(.98); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes dialog-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes dialog-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dock-indicator-in { from { opacity: 0; transform: scaleX(.3); } to { opacity: 1; transform: scaleX(1); } }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-in { from { opacity: .7; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-out { from { opacity: 1; transform: translateY(0); } to { opacity: .7; transform: translateY(100%); } }

@media (prefers-reduced-motion: no-preference) {
  .doc-main > *, .admin-main > * { animation: page-in .3s var(--ease-out) both; }
  .doc-main > *:nth-child(2), .admin-main > *:nth-child(2) { animation-delay: .035s; }
  .doc-main > *:nth-child(3), .admin-main > *:nth-child(3) { animation-delay: .07s; }
}

@media (min-width: 700px) {
  .doc-main { padding-left: 32px; padding-right: 32px; }
  .note-form-options { grid-template-columns: 1fr 1fr auto; align-items: end; }
  .category-form.create { grid-template-columns: 1.1fr 1fr 1.1fr 100px auto; align-items: end; }
  .category-manage-item > form { grid-template-columns: 1.1fr 1fr 1.1fr 90px auto; align-items: end; }
  .article-editor-form { grid-template-columns: minmax(0, 1fr) 270px; align-items: start; }
  .editor-settings { position: sticky; top: 20px; }
  .editor-lower-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (min-width: 980px) {
  .library-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .doc-sidebar { position: sticky; z-index: 1; top: 0; width: var(--sidebar-width); height: 100dvh; transform: none; }
  .sidebar-close, .sidebar-scrim, .mobile-doc-header, .mobile-bottom-nav { display: none !important; }
  .doc-main { padding: 48px 48px 90px; }
  .article-layout { display: grid; grid-template-columns: minmax(0, 720px) var(--rail-width); gap: 54px; justify-content: center; }
  .article-rail { position: sticky; top: 30px; max-height: calc(100dvh - 60px); display: block; align-self: start; overflow-y: auto; }
  .toast { top: 22px; }
  .install-hint { left: auto; right: 22px; bottom: 22px; width: 370px; }

  .admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .admin-sidebar { position: sticky; top: 0; height: 100dvh; padding: 22px 14px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
  .admin-brand { padding: 0 7px 22px; }
  .admin-sidebar nav { display: grid; gap: 3px; }
  .admin-sidebar nav a { padding: 9px 10px; border-radius: 8px; color: var(--text-soft); font-size: 13px; }
  .admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: var(--surface-subtle); color: var(--text); }
  .admin-sidebar nav a.active { font-weight: 700; }
  .admin-sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
  .admin-sidebar-foot a, .admin-sidebar-foot button { width: 100%; min-height: 34px; display: block; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-faint); text-align: left; font-size: 12px; }
  .admin-sidebar-foot a:hover, .admin-sidebar-foot button:hover { background: var(--surface-subtle); color: var(--text); }
  .admin-mobile-head { display: none; }
  .admin-mobile-dock { display: none; }
  .admin-main { padding: 40px 42px 80px; }
  .rich-toolbar { top: 0; }
}

@media (max-width: 699px), (hover: none) and (pointer: coarse) {
  .selection-toolbar { left: 14px; right: 14px; top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); width: auto; min-height: 52px; justify-content: center; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; }
}

@media (max-width: 699px) {
  .annotation-dialog, .ui-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: min(86dvh, 720px);
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .annotation-dialog[open], .ui-dialog[open] { animation-name: sheet-in; }
  .annotation-dialog.is-closing, .ui-dialog.is-closing { animation-name: sheet-out; }
  .ui-dialog-form, .annotation-dialog form { padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
  .toast { top: auto; bottom: calc(82px + env(safe-area-inset-bottom)); }
  .search-filters, .subcategories > div { grid-template-columns: 1fr; }
  .doc-row { grid-template-columns: 20px minmax(0, 1fr); }
  .doc-row-meta { display: none; }
  .admin-page-head { align-items: start; }
  .admin-table-head { display: none; }
  .admin-table-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .admin-table-row > span:nth-child(2) { color: var(--text-soft); font-size: 12px; }
  .admin-table-row > span:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  .admin-table-row time { grid-column: 2; grid-row: 2; text-align: right; }
  .color-field { grid-template-columns: repeat(2, 1fr); }
  .notes-overview a { flex-direction: column; justify-content: center; gap: 5px; padding: 11px 4px; text-align: center; }
  .notes-section-head { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; }
  .notes-section-icon { width: 36px; height: 36px; }
  .highlight-note-source { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 979px) {
  .admin-sidebar {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(82vw, 250px);
    padding: calc(20px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-float);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  body.admin-menu-open .admin-sidebar { display: flex; transform: translateX(0); }
  .admin-sidebar nav { margin-top: 24px; display: grid; gap: 4px; }
  .admin-sidebar nav a { padding: 10px; border-radius: 8px; }
  .admin-sidebar nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
  .admin-sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
  .admin-sidebar-foot a, .admin-sidebar-foot button { width: 100%; padding: 9px; border: 0; background: transparent; color: var(--text-soft); text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .mobile-doc-header, .mobile-bottom-nav, .admin-mobile-dock { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
