:root {
  color-scheme: light;
  accent-color: #111513;
  --bg: #d0d0d0;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-alt: rgba(20, 20, 20, 0.055);
  --surface-raised: rgba(255, 255, 255, 0.68);
  --ink: #151515;
  --muted: #5e5e5e;
  --faint: #818181;
  --line: rgba(20, 20, 20, 0.16);
  --line-strong: rgba(20, 20, 20, 0.32);
  --line-white: rgba(255, 255, 255, 0.88);
  --accent: #111513;
  --accent-soft: rgba(17, 21, 19, 0.075);
  --accent-deep: #111513;
  --on-accent: #ffffff;
  --on-accent-muted: rgba(255, 255, 255, 0.72);
  --warning: #111513;
  --shadow-sm: 0 4px 14px rgba(15, 15, 15, 0.08);
  --shadow: 0 24px 64px rgba(15, 15, 15, 0.2);
  --shadow-card: 0 6px 18px rgba(15, 15, 15, 0.08);
  --shadow-card-hover: 0 12px 28px rgba(15, 15, 15, 0.16);
  --focus-ring: 0 0 0 3px rgba(17, 21, 19, 0.18);
  --header-height: 70px;
  --sidebar-width: 270px;
  --article-width: 940px;
  --shell-gap: 32px;
  --shell-pad: 34px;
  --article-pad: 20px; /* 内容区左右留白（原先散落 42px，2026-10-06 收窄）*/
}

:root[data-theme="dark"] {
  color-scheme: dark;
  accent-color: #f0f1ef;
  --bg: #171717;
  --surface: rgba(34, 34, 34, 0.9);
  --surface-solid: #222222;
  --surface-alt: rgba(255, 255, 255, 0.07);
  --surface-raised: rgba(39, 39, 39, 0.92);
  --ink: #f0f0f0;
  --muted: #bdbdbd;
  --faint: #999999;
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.34);
  --line-white: rgba(255, 255, 255, 0.2);
  --accent: #f0f0f0;
  --accent-soft: rgba(255, 255, 255, 0.09);
  --accent-deep: #ffffff;
  --on-accent: #111513;
  --on-accent-muted: rgba(17, 21, 19, 0.68);
  --warning: #bdbdbd;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.2);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, 0.34);
  --focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-behavior: auto;
  isolation: isolate;
  background: var(--bg);
  scrollbar-color: #9a9a9a transparent;
}

::selection { background: #111513; color: #ffffff; }
:root[data-theme="dark"] ::selection { background: #f0f0f0; color: #111513; }

html::before,
html::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* 主站同款：灰阶底 + 细网格 + 雾化洗色 */
html::before {
  z-index: -2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, 0.09) 1px, transparent 1px),
    #8f8f8f;
  background-size: 32px 32px;
  filter: blur(1.5px);
  transform: scale(1.03) translateZ(0);
  pointer-events: none;
  will-change: transform;
}

html::after {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.48), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(70, 70, 70, 0.22)),
    rgba(210, 210, 210, 0.58);
  backdrop-filter: blur(28px) grayscale(1);
  -webkit-backdrop-filter: blur(28px) grayscale(1);
  transform: translateZ(0);
  pointer-events: none;
}
:root[data-theme="dark"]::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #292929;
  background-size: 32px 32px;
}
:root[data-theme="dark"]::after {
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.1), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.24)),
    rgba(18, 18, 18, 0.78);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  /* clip 不会把 body 变成滚动容器，避免固定/吸顶元素失效 */
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  color: var(--ink);
  background: transparent;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, video, iframe, svg { max-width: 100%; }
button, a, .file-title { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, select:focus-visible, .file-card:focus-visible, .collection-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
a { color: var(--ink); }
a:hover { color: var(--accent-deep); }
code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}
.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(190px, 1fr);
  align-items: center;
  gap: 28px;
  padding: 8px 32px;
  border-bottom: 1px solid var(--line-white);
  background: rgba(247, 247, 247, 0.8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px) saturate(0.75);
  -webkit-backdrop-filter: blur(18px) saturate(0.75);
}
:root[data-theme="dark"] .site-header { background: rgba(24, 24, 24, 0.86); }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { flex: 0 0 auto; width: 46px; height: 46px; }
:root[data-theme="dark"] .brand img { filter: invert(1) grayscale(1); }
.brand-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.22; }
.brand-copy strong { font-size: 21px; font-weight: 900; letter-spacing: -0.01em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; white-space: nowrap; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.icon-button, .quiet-button, .primary-button, .text-button { border: 1px solid transparent; cursor: pointer; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; background: transparent; color: var(--ink); font-size: 20px; line-height: 1; }
.icon-button:hover, .icon-button.active { background: var(--surface-alt); border-color: var(--line); }
.quiet-button { min-height: 38px; padding: 7px 13px; border-color: var(--line-strong); background: var(--surface-raised); color: var(--ink); font-size: 13px; font-weight: 800; transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 180ms ease, background 180ms ease; transform: translateZ(0); }
.quiet-button:hover { transform: translate3d(0, -2px, 0); border-color: var(--accent); background: var(--surface-solid); }
.quiet-button:active { transform: translate3d(0, 0, 0) scale(0.97); transition: transform 70ms ease-out; }
.primary-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 7px 16px; border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 800; text-decoration: none; transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease, box-shadow 200ms ease; transform: translateZ(0); }
.primary-button:hover { transform: translate3d(0, -2px, 0); background: #232725; color: var(--on-accent); box-shadow: var(--shadow-sm); }
.primary-button:active { transform: translate3d(0, 0, 0) scale(0.97); transition: transform 70ms ease-out; }
:root[data-theme="dark"] .primary-button:hover { background: #ffffff; }
.text-button { padding: 5px 8px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 800; }
.text-button:hover { background: var(--surface-alt); }
.mobile-only { display: none; }
.sidebar-backdrop { display: none; }

.page-shell {
  width: min(1310px, 100%);
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, var(--article-width));
  gap: var(--shell-gap);
  padding: var(--shell-pad) var(--shell-pad) 88px;
}

.sidebar { align-self: start; min-width: 0; padding-bottom: 28px; }
.nav-heading { margin: 0 0 7px; padding: 0 10px 7px; border-bottom: 2px solid var(--line-strong); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.nav-heading:not(:first-child) { margin-top: 24px; }
.nav-link { width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 0; border-left: 3px solid transparent; background: transparent; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease, border-color 180ms ease; transform: translateZ(0); }
.nav-link:hover { transform: translate3d(3px, 0, 0); background: var(--surface-alt); }
.nav-link:active { transform: translate3d(1px, 0, 0); transition: transform 70ms ease-out; }
.nav-link.active { border-left-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 800; }
.nav-link b { flex: 0 0 auto; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; white-space: nowrap; }
.nav-link.active b { color: var(--on-accent-muted); }
.folder-link span::before { content: "□"; display: inline-block; width: 19px; color: var(--muted); font-size: 12px; }
.nav-link.active span::before { color: var(--on-accent-muted); }
.sidebar-note { margin-top: 32px; padding: 14px; border: 1px solid var(--line-white); border-left: 4px solid var(--accent); background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(247, 247, 247, 0.58)); box-shadow: var(--shadow-sm), inset 0 1px 1px rgba(255, 255, 255, 0.9); font-size: 12px; }
:root[data-theme="dark"] .sidebar-note { background: var(--surface-raised); }
.sidebar-note strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: 0.12em; }
.sidebar-note p { margin: 5px 0 0; color: var(--muted); }

/* 桌面导航固定：正文滚动不会带动左栏，左栏内容超出时只有它自己滚动 */
@media (min-width: 821px) {
  .sidebar {
    position: fixed;
    z-index: 20;
    top: calc(var(--header-height) + var(--shell-pad));
    left: max(var(--shell-pad), calc(50% - 621px));
    width: var(--sidebar-width);
    max-height: calc(100vh - var(--header-height) - var(--shell-pad) - 34px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 24px;
    scrollbar-width: thin;
  }
  .sidebar::-webkit-scrollbar { width: 5px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); }
  .article { grid-column: 2; }
}

@media (min-width: 821px) and (max-width: 1180px) {
  :root { --sidebar-width: 220px; --shell-gap: 20px; --shell-pad: 22px; }
  .sidebar {
    top: calc(var(--header-height) + 22px);
    left: 22px;
    width: 220px;
    max-height: calc(100vh - var(--header-height) - 44px);
  }
}

.article { min-width: 0; overflow: hidden; border: 1px solid var(--line-white); background: linear-gradient(145deg, rgba(255, 255, 255, 0.91), rgba(247, 247, 247, 0.82)); box-shadow: var(--shadow), inset 0 1px 1px rgba(255, 255, 255, 0.95); }
:root[data-theme="dark"] .article { background: linear-gradient(145deg, rgba(40, 40, 40, 0.95), rgba(31, 31, 31, 0.92)); }
.article-tools { min-height: 52px; display: flex; align-items: center; justify-content: flex-start; padding: 0 32px 0 28px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--accent); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.article section { scroll-margin-top: calc(var(--header-height) + 22px); }
.article h1, .article h2, .article h3 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 900; color: var(--ink); }
.article h1 { margin: 38px var(--article-pad) 0; padding-bottom: 18px; border-bottom: 2px solid var(--line-strong); font-size: clamp(38px, 5.5vw, 62px); line-height: 1.12; letter-spacing: -0.02em; }
.article h2 { margin: 42px var(--article-pad) 16px; padding: 0 0 11px 12px; border-bottom: 2px solid var(--line-strong); border-left: 4px solid var(--accent); font-size: clamp(24px, 3vw, 32px); line-height: 1.25; }
.article h3 { margin: 26px var(--article-pad) 8px; font-size: 19px; }
.article p { max-width: 78ch; }
.article > #homeView > section > p, .article > #homeView > section > dl, .article > #homeView > section > .audio-card, .article > #homeView > section > .collection-index, .article > #homeView > section > .article-footer { margin-left: var(--article-pad); margin-right: var(--article-pad); }
.subtitle { margin-top: 10px !important; margin-bottom: 22px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.lead-copy { margin-top: 24px; font-size: 16px; line-height: 1.9; }
.notice { display: flex; gap: 10px; margin: 18px var(--article-pad); padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface-alt); }
.notice strong { flex: 0 0 auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.archive-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 30px !important; margin-bottom: 8px !important; border-top: 2px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.archive-status div { padding: 14px 15px; border-right: 1px solid var(--line); }
.archive-status div:first-child { padding-left: 0; }
.archive-status div:last-child { border-right: 0; }
.archive-status dt { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.archive-status dd { margin: 3px 0 0; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 900; }

.collection-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 20px !important; }
.collection-card { position: relative; min-height: 104px; display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); background: var(--surface-raised); color: var(--ink); text-align: left; cursor: pointer; transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background 200ms ease, box-shadow 220ms ease, border-color 200ms ease; transform: translateZ(0); will-change: transform; }
.collection-card:hover, .collection-card:focus-visible { transform: translate3d(0, -3px, 0); border-color: var(--accent); background: var(--surface-solid); box-shadow: var(--shadow-card-hover); }
.collection-card:active { transform: translate3d(0, 0, 0) scale(0.985); transition: transform 70ms ease-out; }
.collection-card strong { color: var(--ink); font-size: 15px; font-weight: 900; line-height: 1.4; }
.collection-card span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.collection-card::after { content: "→"; position: absolute; right: 14px; bottom: 12px; color: var(--ink); font-size: 18px; font-weight: 800; opacity: 0.72; transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); transform: translateZ(0); }
.collection-card:hover::after { transform: translate3d(4px, 0, 0); opacity: 1; }
.principle-list { padding-left: 22px; }
.principle-list li { margin: 7px 0; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 var(--article-pad); border-bottom: 2px solid var(--line-strong); }
.section-heading h2 { margin-left: 0; margin-right: 0; margin-bottom: 0; border-bottom: 0; }
.section-heading p { margin: 3px 0 13px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.view-controls { display: flex; gap: 4px; padding-bottom: 10px; }
.folder-drop { min-height: 112px; display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 18px; margin: 22px var(--article-pad) 16px; padding: 18px; border: 2px dashed var(--line-strong); background: var(--surface-alt); }
.folder-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.folder-drop p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.drop-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 28px; }
.filter-row { display: flex; gap: 18px; margin: 18px var(--article-pad); padding: 12px 14px; border-left: 4px solid var(--accent); background: var(--surface-alt); }
.filter-row label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; }
.filter-row select { min-height: 34px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state img { opacity: 0.58; filter: grayscale(1); }
.empty-state h3 { margin: 12px 0 4px; color: var(--ink); }
.empty-state p { margin: 0 auto; }

.file-list { display: grid; gap: 0; margin: 0 var(--article-pad); }
.file-card { min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); cursor: pointer; transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease, border-color 180ms ease; transform: translateZ(0); content-visibility: auto; contain-intrinsic-size: auto 71px; }
.file-thumb { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-solid); }
.file-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.file-thumb.is-icon { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.file-card:hover .file-thumb, .file-card:focus-visible .file-thumb { border-color: var(--line-strong); }
.file-card:hover, .file-card:focus-visible { transform: translate3d(4px, 0, 0); background: var(--surface-raised); }
.file-card:active { transform: translate3d(2px, 0, 0); transition: transform 70ms ease-out; }
.file-main { min-width: 0; }
.file-title { display: block; overflow: hidden; color: var(--ink); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.file-card:hover .file-title { text-decoration: underline; text-underline-offset: 3px; }
.file-meta { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: nowrap; }
.file-list.grid-view { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid-view .file-card { min-height: 145px; grid-template-columns: 1fr; align-content: start; gap: 8px; padding: 14px; border: 1px solid var(--line); }
.grid-view .file-thumb { width: 100%; height: 104px; }
.grid-view .file-meta { white-space: normal; }

/* ===== 子文件夹浏览与路径导航（2026-09-26 同步本地目录层级）===== */
.path-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 var(--article-pad) 14px; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface-alt); font-size: 12px; }
.path-up { flex: 0 0 auto; min-height: 30px; padding: 4px 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 800; cursor: pointer; }
.path-up:hover, .path-up:focus-visible { background: var(--surface-raised); }
.path-crumb { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.path-link { max-width: 100%; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-align: left; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.path-link:last-child { color: var(--ink); font-weight: 800; text-decoration: none; }
.path-sep { color: var(--muted); }

/* ===== 子文件夹：资源管理器列表样式（名称 / 修改日期 / 类型 / 大小）2026-10-06 ===== */
.subfolder-list { margin: 0 var(--article-pad) 16px; }
.folder-table { border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.folder-table-head, .folder-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(104px, 138px) 66px minmax(64px, 92px); align-items: center; gap: 12px; padding: 9px 14px; }
.folder-table-head { border-bottom: 1px solid var(--line); background: var(--surface-alt); color: var(--muted); font-size: 11px; }
.folder-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background 140ms ease, padding-left 140ms ease; }
.folder-row:last-child { border-bottom: 0; }
.folder-row:hover, .folder-row:focus-visible { background: var(--surface-raised); padding-left: 18px; }
.col-name { display: flex; align-items: center; min-width: 0; gap: 9px; }

.folder-name { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { margin-left: auto; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: nowrap; }
.col-date, .col-type { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.col-size { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; text-align: right; white-space: nowrap; }
.col-size:empty { color: var(--faint); }

.toc { display: none; }
.article-footer { margin: 46px var(--article-pad) 0 !important; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

/* 预览：主站式直角面板 + 长图阅览台 */
.inline-preview { margin: 2px 6px 14px; padding: 12px; border: 1px solid var(--line-strong); background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(247, 247, 247, 0.58)); box-shadow: var(--shadow-sm); animation: inline-slide 220ms cubic-bezier(0.16, 1, 0.3, 1) both; will-change: transform, opacity; transform: translateZ(0); overscroll-behavior: contain; }
:root[data-theme="dark"] .inline-preview { background: var(--surface-raised); }
@keyframes inline-slide { from { opacity: 0; transform: translate3d(0, -10px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
.inline-preview .ip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.inline-preview .ip-title { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.inline-preview .ip-title strong { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.inline-preview .ip-size { flex: 0 0 auto; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.inline-preview .ip-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.inline-preview .ip-meta { color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.inline-preview .ip-badge { padding: 2px 7px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.inline-preview .ip-zoom, .inline-preview .ip-close { flex: 0 0 auto; padding: 3px 9px; border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); font-size: 12px; cursor: pointer; }
.inline-preview .ip-zoom:hover, .inline-preview .ip-close:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.inline-preview .ip-zoom[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.inline-preview .ip-body { display: grid; place-items: center; max-height: 56vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); }
.inline-preview .ip-body img, .inline-preview .ip-body video { max-width: 100%; max-height: 56vh; object-fit: contain; }
.inline-preview .ip-body-image { display: block; max-height: none; overflow: visible; background: transparent; border: 0; }
.inline-preview .ip-stage { width: 100%; display: grid; place-items: center; max-height: 62vh; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); background-image: linear-gradient(45deg, rgba(128, 128, 128, 0.1) 25%, transparent 25%, transparent 75%, rgba(128, 128, 128, 0.1) 75%), linear-gradient(45deg, rgba(128, 128, 128, 0.1) 25%, transparent 25%, transparent 75%, rgba(128, 128, 128, 0.1) 75%); background-size: 18px 18px; background-position: 0 0, 9px 9px; background-color: var(--surface); -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.inline-preview .ip-stage img { display: block; width: auto; max-width: 100%; max-height: 62vh; height: auto; object-fit: contain; }
.inline-preview .ip-body.is-long .ip-stage { display: block; max-height: 72vh; }
.inline-preview .ip-body.is-long .ip-stage img { width: 100%; max-width: 100%; max-height: none; margin: 0 auto; }
.inline-preview .ip-body.zoom-actual .ip-stage { display: block; }
.inline-preview .ip-body.zoom-actual .ip-stage img { width: auto; max-width: none; max-height: none; margin: 0 auto; }
.inline-preview .ip-body iframe { width: 100%; height: 56vh; border: 0; background: #fff; }
.inline-preview .ip-body audio { width: min(560px, 92%); margin: 18px auto; }
.inline-preview .ip-body pre { width: 100%; min-height: 100%; margin: 0; padding: 18px; overflow: auto; background: var(--surface); color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.inline-preview .ip-body .unsupported { padding: 22px; text-align: center; color: var(--muted); }
.inline-preview .ip-foot { margin-top: 10px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.inline-preview .ip-hint { margin-right: auto; color: var(--muted); font-size: 12px; }

/* 录音与文字稿 */
.audio-card { margin: 18px var(--article-pad) 0; padding: 18px; border: 1px solid var(--line-white); border-left: 4px solid var(--accent); background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(247, 247, 247, 0.56)); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .audio-card { background: var(--surface-raised); }
.audio-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.audio-card-head strong { color: var(--ink); font-size: 15px; font-weight: 900; }
.audio-card-head span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; letter-spacing: 0.04em; }
.audio-player { display: block; width: 100%; max-width: 100%; height: 42px; margin-top: 12px; }
.audio-player::-webkit-media-controls-enclosure, .audio-player::-webkit-media-controls-panel { background: var(--surface-alt); }
.audio-card-note { margin: 8px 0 0; color: var(--faint); font-size: 11px; }
.transcript { margin-top: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.3); }
:root[data-theme="dark"] .transcript { background: rgba(0, 0, 0, 0.18); }
.transcript-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-alt); }
.transcript-head strong { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.transcript-head span { color: var(--muted); font-size: 11px; }
.transcript-legend { padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(20, 20, 20, 0.035); }
:root[data-theme="dark"] .transcript-legend { background: rgba(255, 255, 255, 0.04); }
.tr-legend-title { display: block; margin-bottom: 7px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.tr-legend-list { display: flex; flex-wrap: wrap; gap: 5px 18px; margin: 0; padding: 0; list-style: none; }
.tr-legend-list li { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12px; }
.tr-legend-list b { flex: 0 0 auto; color: var(--ink); font-weight: 900; }
.tr-legend-list span { color: var(--muted); }
.tr-legend-note { margin: 8px 0 0; color: var(--faint); font-size: 11px; line-height: 1.6; }
.transcript-body { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; }
.tr-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 8px 14px; border-bottom: 1px solid rgba(20, 20, 20, 0.09); }
:root[data-theme="dark"] .tr-row { border-bottom-color: rgba(255, 255, 255, 0.09); }
.tr-row:last-child { border-bottom: 0; }
.tr-time { align-self: start; margin-top: 1px; padding: 2px 0; border: 0; background: transparent; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.5; text-align: left; cursor: pointer; }
.tr-time:hover, .tr-time.is-active { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.tr-time.is-current { margin-left: -5px; padding: 2px 5px; background: var(--accent); color: var(--on-accent); font-weight: 800; text-decoration: none; }
.tr-content { min-width: 0; }
.tr-who { display: block; margin-bottom: 2px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.tr-text { display: block; margin: 0 0 8px; color: var(--ink); font-size: 13px; line-height: 1.75; }
.tr-text:last-child { margin-bottom: 0; }
.tr-content .tr-text + .tr-text { margin-top: 2px; }

@media (max-width: 1180px) {
  .site-header { grid-template-columns: minmax(210px, 1fr) auto; gap: 16px; padding-inline: 20px; }
  .page-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
}

@media (max-width: 980px) {
  /* 中等宽度：先舍掉「类型」列，保证文件夹名有足够空间 */
  .folder-table-head, .folder-row { grid-template-columns: minmax(0, 1fr) minmax(104px, 138px) minmax(64px, 92px); }
  .col-type { display: none; }
}

@media (max-width: 820px) {
  :root { --header-height: 62px; }
  html { overflow-x: hidden; }
  body { width: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; }
  .site-header { width: 100%; max-width: 100%; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; padding: 7px 12px; overflow: hidden; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(247, 247, 247, 0.96); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
  :root[data-theme="dark"] .site-header { background: rgba(24, 24, 24, 0.96); }
  .mobile-only { display: inline-grid; }
  .brand img { width: 40px; height: 40px; }
  .brand-copy small { display: none; }
  .brand-copy strong { max-width: 100%; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .header-actions .quiet-button { display: none; }
  .page-shell { display: block; width: 100%; max-width: 100%; height: auto; overflow-x: hidden; overflow-y: visible; padding: 0 0 40px; overscroll-behavior-x: none; }
  html.nav-open, body.nav-open { overflow: hidden; overscroll-behavior: none; }
  .sidebar-backdrop { position: fixed; z-index: 45; inset: var(--header-height) 0 0; display: block; padding: 0; border: 0; background: rgba(17, 21, 19, 0.48); opacity: 0; visibility: hidden; pointer-events: none; backdrop-filter: blur(3px) grayscale(1); -webkit-backdrop-filter: blur(3px) grayscale(1); transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1), visibility 240ms ease; will-change: opacity, visibility; }
  /* 手势封锁只加在遮罩上：写在 body 上会连抽屉自身的触摸滚动一起禁掉（手机端划不动/黏手） */
  body.nav-open .sidebar-backdrop { opacity: 1; visibility: visible; pointer-events: auto; touch-action: none; }
  .sidebar { position: fixed; z-index: 50; top: var(--header-height); right: auto; bottom: 0; left: 0; width: min(300px, 86vw); max-width: 100vw; padding: 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; will-change: transform; border-right: 1px solid var(--line); background: var(--surface-solid); box-shadow: var(--shadow); transform: translate3d(-105%, 0, 0); transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; }
  .sidebar, .sidebar * { touch-action: pan-y; }
  .sidebar.open { transform: translate3d(0, 0, 0); pointer-events: auto; }
  body.nav-open .article, body.nav-open .site-header .brand, body.nav-open .header-actions { pointer-events: none; }
  .article { position: relative; width: 100%; max-width: 100%; min-width: 0; height: auto; overflow-x: hidden; overflow-y: visible; padding-bottom: 42px; border-top: 0; border-right: 0; border-left: 0; box-shadow: none; touch-action: pan-y; }
  .article h1 { margin: 30px 20px 0; font-size: 36px; }
  .article h2 { margin-left: 20px; margin-right: 20px; font-size: 24px; }
  .article h3 { margin-left: 20px; margin-right: 20px; }
  .article > #homeView > section > p, .article > #homeView > section > dl, .article > #homeView > section > .audio-card, .article > #homeView > section > .collection-index, .article > #homeView > section > .article-footer { margin-left: 20px; margin-right: 20px; }
  .archive-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-status div:nth-child(2) { border-right: 0; }
  .archive-status div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .archive-status div:nth-child(3) { padding-left: 0; }
  .folder-drop { grid-template-columns: 46px 1fr; gap: 12px; margin-left: 20px; margin-right: 20px; }
  .folder-drop .primary-button { grid-column: 1 / -1; }
  .filter-row, .section-heading, .file-list, .subfolder-list { margin-left: 20px; margin-right: 20px; }
  .file-list.grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audio-card { margin-left: 20px; margin-right: 20px; }
  .tr-row { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 7px 12px; }
  .transcript-body { max-height: 300px; }
}

@media (max-width: 520px) {
  .article-tools { align-items: flex-start; min-height: 48px; padding: 8px 20px; }
  .section-heading { align-items: center; }
  .filter-row { align-items: stretch; flex-direction: column; gap: 10px; }
  .filter-row label { justify-content: space-between; }
  .filter-row select { width: 58%; }
  .file-card { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
  .file-thumb { width: 40px; height: 40px; }
  .file-title { min-width: 0; max-width: 100%; }
  .collection-index { grid-template-columns: 1fr; }
  .inline-preview { max-width: 100%; margin-left: 4px; margin-right: 4px; overflow: hidden; }
  .inline-preview .ip-head { gap: 8px; }
  .inline-preview .ip-title { flex-wrap: wrap; }
  .inline-preview .ip-actions { flex-wrap: wrap; }
  .inline-preview .ip-meta { display: none; }
  .inline-preview .ip-stage, .inline-preview .ip-body.is-long .ip-stage { max-height: 66vh; }
}

@media print {
  html::before, html::after, .site-header, .sidebar, .article-tools, .folder-drop, .filter-row, .view-controls { display: none !important; }
  body, .page-shell, .article { background: #fff; color: #000; }
  .page-shell { display: block; padding: 0; }
  .article { border: 0; padding: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ==================================================================
   手机端操作体验优化（2026-09-19）
   1. 触点放大到 >=44px   2. iOS 输入框不缩放   3. 刘海/小黑条安全区
   4. 转录时间戳可点方块 + 整行可点   5. 触摸即时反馈
   ================================================================== */

/* 去掉点击蓝框与双击缩放延迟（捏合缩放仍可用） */
a, button, select, input, textarea, summary, [role="button"],
.nav-link, .file-card, .collection-card, .folder-row, .folder-drop, .tr-row, .icon-button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 触摸设备没有 hover，去除导致触碰滚动粘手的 transform，仅保留背景反馈 */
@media (hover: none) {
  .nav-link { transform: none !important; transition: background 120ms ease, border-color 120ms ease !important; }
  .nav-link:hover, .nav-link:active { transform: none !important; background: var(--surface-alt); }
  .file-card { transform: none !important; }
  .file-card:hover, .file-card:active { transform: none !important; background: var(--surface-raised); }
  .collection-card { will-change: auto; }
  .collection-card:active, .folder-drop:active, .folder-row:active { transform: none !important; background: var(--surface-alt); }
  .icon-button:active, .quiet-button:active, .primary-button:active, .text-button:active { background: var(--surface-alt); }
  .tr-time:active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .inline-preview .ip-close:active, .inline-preview .ip-zoom:active { background: var(--surface-alt); }
}

@media (max-width: 820px) {
  /* --- 安全区：刘海屏顶部 + 底部小黑条 --- */
  :root { --header-height: calc(62px + env(safe-area-inset-top, 0px)); }
  .site-header {
    padding-top: calc(7px + env(safe-area-inset-top, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  .page-shell {
    padding-top: 0;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .article { padding-bottom: calc(42px + env(safe-area-inset-bottom, 0px)); }

  /* --- 触点放大 --- */
  .icon-button { width: 44px; height: 44px; font-size: 22px; }
  .quiet-button, .primary-button { min-height: 44px; }
  .text-button { min-height: 40px; padding: 8px 10px; }
  .nav-link { min-height: 44px; padding: 8px 10px; }
  .nav-link b { font-size: 12px; }
  .inline-preview .ip-close, .inline-preview .ip-zoom { min-height: 40px; padding: 8px 12px; }
  .inline-preview .ip-actions { gap: 8px; }
  .article-tools { min-height: 56px; }

  /* --- 表单控件：>=16px 避免 iOS 聚焦时把整页放大 --- */
  .filter-row select, select, input, textarea { font-size: 16px; }
  .filter-row select { min-height: 44px; }

  /* --- 播放器：加高，进度条更好按 --- */
  .audio-player { height: 48px; }

  /* --- 转录：时间戳做成方块，整行都能点 --- */
  .transcript-body { max-height: min(52svh, 420px); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .tr-row { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .tr-time {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 58px; min-height: 34px; margin-top: 0; padding: 6px 8px;
    border: 1px solid var(--line-soft); background: var(--surface-alt);
    font-size: 12px; font-weight: 800; text-align: center; text-decoration: none;
  }
  .tr-time:hover, .tr-time.is-active { text-decoration: none; }
  .tr-time.is-active { border-color: var(--line-strong); color: var(--ink); }
  .tr-time.is-current { margin-left: 0; padding: 6px 8px; border-color: var(--accent); }
  .tr-text { font-size: 14.5px; line-height: 1.8; }
  .tr-who { font-size: 11px; }
  .transcript-head { padding: 12px 14px; }
  /* 子文件夹与路径栏：窄屏单列、触点加大 */
  .path-bar { margin: 0 12px 12px; padding: 8px; font-size: 12px; }
  .path-up { min-height: 40px; }
  .path-link { min-height: 34px; display: inline-flex; align-items: center; }
  .subfolder-list { margin: 0 12px 14px; }
  .folder-table-head { display: none; }
  .folder-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 11px 12px; }
  .folder-row .col-date { grid-column: 1; grid-row: 2; font-size: 11px; }
  .folder-row .col-size { grid-column: 2; grid-row: 1 / span 2; }
  .folder-row .folder-count { display: none; }
}

@media (max-width: 380px) {
  .tr-row { grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .tr-time { min-width: 52px; font-size: 11px; }
  .tr-text { font-size: 14px; }
}
