
:root {
  --color-primary: #1a3a5c;
  --color-primary-light: #2a5080;
  --color-primary-dark: #0f2338;
  --color-accent: #c9a227;
  --color-accent-light: #e8c04a;
  --color-accent-dark: #a07d10;
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-surface-alt: #f0f2f5;
  --color-border: #dde1e7;
  --color-border-light: #eaecf0;
  --color-text: #1c2333;
  --color-text-secondary: #5a6478;
  --color-text-muted: #8a95a8;
  --color-hover: #f0f4f8;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-edited: #7c3aed;

  --desktop-sidebar-width: 384px;
  --sidebar-width: var(--desktop-sidebar-width);
  --desktop-content-width: 950px;
  --topbar-height: 56px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
  --radius: 6px;
  --radius-lg: 10px;
}

.video-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  background: #050505;
}

.file-preview-theme-surface {
  background: #fff;
}

.file-preview-media-box {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #f8fafc;
}

.file-preview-media-box--image {
  padding: 24px;
}

.file-preview-media-box--audio {
  padding: 40px;
}

.video-preview-stage video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ios-responsive-video {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100vw !important;
  max-height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  object-fit: contain !important;
  margin-left: auto !important;
  margin-right: auto !important;
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .video-preview-stage,
  .mine-file-media-box.video-preview-stage {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
  }

  body.ios-video-preview-active .mobile-sidebar-swipe-overlay {
    display: none !important;
    pointer-events: none !important;
  }
}

.video-preview-error {
  display: flex;
  width: min(520px, calc(100% - 32px));
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px;
  border: 1px solid #374151;
  border-radius: 6px;
  background: #111827;
  color: #d1d5db;
  text-align: center;
  line-height: 1.6;
}

.video-preview-error[hidden] {
  display: none;
}

.video-preview-error strong {
  color: #fff;
  font-size: 16px;
}

.video-preview-error a {
  color: #93c5fd;
}

.editable-content video,
.homepage-rich-content video,
.docfile-note-top-display video,
.docfile-note-bottom-display video,
.mine-file-note-top-display video,
.mine-file-note-bottom-display video,
.ke-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
  background: #000;
}

.rich-media-audio,
.editable-content audio,
.homepage-rich-content audio,
.docfile-note-top-display audio,
.docfile-note-bottom-display audio,
.mine-file-note-top-display audio,
.mine-file-note-bottom-display audio,
.ke-content audio {
  display: block;
  width: min(100%, 550px);
  max-width: 100%;
  margin: 12px auto;
}

.rich-media-block {
  display: block;
  width: 100%;
  min-height: 24px;
  margin: 8px 0;
  text-align: center;
}

.rich-media-block + p {
  min-height: 1em;
}

:root[data-color-mode="dark"] {
  color-scheme: dark;
  --color-bg: #111418 !important;
  --color-surface: #1b2027;
  --color-surface-alt: #252c35;
  --color-border: #3b4552;
  --color-border-light: #303945;
  --color-text: #edf1f5;
  --color-text-secondary: #bdc6d2;
  --color-text-muted: #8f9baa;
  --color-hover: #2b3440;
  --color-dark-mode-heading: #f4f7fb;
  --color-dark-mode-text: #d8e0ea;
  --color-dark-mode-muted: #aeb9c7;
  --color-dark-mode-link: #8fc5ff;
  --color-dark-mode-selection: #343d49;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.48), 0 4px 8px rgba(0,0,0,0.35);
}

/* Keep authored rich text readable when it contains light-theme inline colors. */
:root[data-color-mode="dark"] .homepage-rich-content,
:root[data-color-mode="dark"] .editable-content,
:root[data-color-mode="dark"] .docfile-note-top-display,
:root[data-color-mode="dark"] .docfile-note-bottom-display,
:root[data-color-mode="dark"] .mine-file-note-top-display,
:root[data-color-mode="dark"] .mine-file-note-bottom-display {
  color: var(--color-dark-mode-text) !important;
}

:root[data-color-mode="dark"] .homepage-rich-content :is(h1, h2, h3, h4, h5, h6),
:root[data-color-mode="dark"] .editable-content :is(h1, h2, h3, h4, h5, h6),
:root[data-color-mode="dark"] .docfile-note-top-display :is(h1, h2, h3, h4, h5, h6),
:root[data-color-mode="dark"] .docfile-note-bottom-display :is(h1, h2, h3, h4, h5, h6),
:root[data-color-mode="dark"] .mine-file-note-top-display :is(h1, h2, h3, h4, h5, h6),
:root[data-color-mode="dark"] .mine-file-note-bottom-display :is(h1, h2, h3, h4, h5, h6) {
  color: var(--color-dark-mode-heading) !important;
}

:root[data-color-mode="dark"] .homepage-rich-content :is(p, li, div, span, blockquote)[style*="color"],
:root[data-color-mode="dark"] .editable-content :is(p, li, div, span, blockquote)[style*="color"],
:root[data-color-mode="dark"] .docfile-note-top-display [style*="color"],
:root[data-color-mode="dark"] .docfile-note-bottom-display [style*="color"],
:root[data-color-mode="dark"] .mine-file-note-top-display [style*="color"],
:root[data-color-mode="dark"] .mine-file-note-bottom-display [style*="color"] {
  color: var(--color-dark-mode-text) !important;
}

:root[data-color-mode="dark"] .homepage-rich-content a,
:root[data-color-mode="dark"] .editable-content a,
:root[data-color-mode="dark"] .docfile-note-top-display a,
:root[data-color-mode="dark"] .docfile-note-bottom-display a,
:root[data-color-mode="dark"] .mine-file-note-top-display a,
:root[data-color-mode="dark"] .mine-file-note-bottom-display a {
  color: var(--color-dark-mode-link) !important;
}

:root[data-color-mode="dark"] .welcome-title,
:root[data-color-mode="dark"] .stat-num,
:root[data-color-mode="dark"] .rolling-digit-face,
:root[data-color-mode="dark"] .plaza-sort-menu-item.active,
:root[data-color-mode="dark"] .plaza-sort-menu-item:hover {
  color: var(--color-dark-mode-link);
}

/* Article pages and rich-text/editor surfaces must use the same dark paper. */
:root[data-color-mode="dark"] :is(
  .page-content,
  .welcome-screen,
  .editable-content,
  .sjqy-content-frame,
  .docfile-note-display,
  .mine-file-note-display,
  .mine-file-note-display-bottom,
  #kindEditorContainer,
  #kindEditorBottomContainer,
  .mine-file-editor-bottom
) {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}

:root[data-color-mode="dark"] :is(
  .editable-content,
  .sjqy-content-frame,
  .docfile-note-display,
  .mine-file-note-display,
  .mine-file-note-display-bottom
) :is(p, li, div, span, blockquote, td, th) {
  color: var(--color-dark-mode-text) !important;
}

:root[data-color-mode="dark"] :is(
  .editable-content,
  .sjqy-content-frame,
  .docfile-note-display,
  .mine-file-note-display,
  .mine-file-note-display-bottom
) :is(h1, h2, h3, h4, h5, h6) {
  color: var(--color-dark-mode-heading) !important;
}

:root[data-color-mode="dark"] :is(
  .editable-content,
  .sjqy-content-frame,
  .docfile-note-display,
  .mine-file-note-display,
  .mine-file-note-display-bottom
) :is(table, td, th, hr) {
  border-color: var(--color-border) !important;
}

:root[data-color-mode="dark"] :is(
  .editable-content,
  .sjqy-content-frame,
  .docfile-note-display,
  .mine-file-note-display,
  .mine-file-note-display-bottom
) :is([style*="background: white"], [style*="background:#fff"], [style*="background-color: white"], [style*="background-color:#fff"]) {
  background: var(--color-surface-alt) !important;
}
:root[data-color-mode="dark"] :is(input, textarea, select) {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

:root[data-color-mode="dark"] :is(input, textarea)::placeholder {
  color: var(--color-dark-mode-muted);
  opacity: 1;
}

:root[data-color-mode="dark"] :is(.modal, .dialog, .popup, .node-action-menu) {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

:root[data-color-mode="dark"] .modal :is(label, span, p)[style*="color"],
:root[data-color-mode="dark"] #ftFolderDropOverlayText {
  color: var(--color-dark-mode-text) !important;
}

:root[data-color-mode="dark"] .tab-btn.active {
  color: var(--color-dark-mode-link);
  border-bottom-color: var(--color-dark-mode-link);
}

/* In dark mode selection is indicated by its background only. Keep each
   file or folder label at the same readable color it had before selection. */
:root[data-color-mode="dark"] :is(
  .tree-node-row.active,
  .plaza-fixed-article.active,
  .mine-fixed-article.active,
  #sidebarTree .ft-edit-row.active,
  #mineFolderList .mine-tree-folder-row.active,
  .mobile-touch-selected
) {
  background: var(--color-dark-mode-selection) !important;
  color: inherit !important;
}

:root[data-color-mode="dark"] :is(
  .tree-node-row.active,
  .plaza-fixed-article.active,
  .mine-fixed-article.active,
  #sidebarTree .ft-edit-row.active,
  #mineFolderList .mine-tree-folder-row.active,
  .mobile-touch-selected
) :is(.tree-node-name, .mine-tree-folder-name, .mine-tree-file-name, .mine-tree-label) {
  color: inherit !important;
}

:root[data-color-mode="light"] {
  color-scheme: light;
  --color-bg: #f5f6f8 !important;
  --color-surface: #ffffff;
  --color-surface-alt: #f0f2f5;
  --color-border: #dde1e7;
  --color-border-light: #eaecf0;
  --color-text: #1c2333;
  --color-text-secondary: #5a6478;
  --color-text-muted: #8a95a8;
  --color-hover: #f0f4f8;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  overflow: hidden;
  height: 100vh;
}

.topbar {
  display: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-center {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  white-space: nowrap;
}

.topbar-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  line-height: 0;
}

.brand-icon img {
  display: block;
}

.brand-icon-menu-wrap {
  position: relative;
  flex: 0 0 auto;
  line-height: 0;
}

.brand-menu-toggle {
  position: absolute;
  left: -5px;
  bottom: -5px;
  z-index: 3;
  width: 15px;
  height: 15px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--color-accent, #c9a227);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.brand-menu-toggle svg {
  width: 9px;
  height: 9px;
}

.brand-menu-toggle:hover,
.brand-menu-toggle[aria-expanded="true"] {
  background: #e0b72f;
}

.brand-menu-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.brand-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 1000;
  width: 224px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
  line-height: normal;
}

.brand-menu[hidden] {
  display: none;
}

.brand-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.brand-menu-item:hover,
.brand-menu-item:focus-visible {
  background: var(--color-hover);
  outline: none;
}

.brand-menu-item-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.brand-menu-item-icon svg {
  width: 16px;
  height: 16px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-menu-item-text {
  min-width: 0;
  white-space: nowrap;
}

.brand-menu-item-value {
  color: var(--color-text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.brand-menu-submenu-wrap {
  position: relative;
}

.brand-submenu-toggle {
  grid-template-columns: 18px minmax(0, 1fr) 12px;
}

.brand-submenu-arrow {
  color: var(--color-text-muted);
  font-size: 20px;
  line-height: 1;
  text-align: right;
}

.brand-appearance-submenu,
.brand-language-submenu {
  position: absolute;
  top: -6px;
  left: calc(100% + 6px);
  z-index: 1001;
  width: 174px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.brand-appearance-submenu[hidden],
.brand-language-submenu[hidden] {
  display: none;
}

.brand-appearance-option,
.brand-language-option {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.brand-appearance-option:hover,
.brand-appearance-option:focus-visible,
.brand-language-option:hover,
.brand-language-option:focus-visible {
  background: var(--color-hover);
  outline: none;
}

.brand-appearance-option-icon,
.brand-language-option-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.brand-appearance-option-icon svg,
.brand-language-option-icon svg {
  width: 16px;
  height: 16px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-appearance-check,
.brand-language-check {
  visibility: hidden;
  color: var(--color-accent);
  font-weight: 700;
}

.brand-appearance-option[aria-checked="true"] .brand-appearance-check,
.brand-language-option[aria-checked="true"] .brand-language-check {
  visibility: visible;
}

@media (max-width: 460px) {
  .brand-appearance-submenu,
  .brand-language-submenu {
    top: calc(100% + 4px);
    right: 0;
    left: auto;
  }
}

.brand-menu-divider {
  height: 1px;
  margin: 5px 8px;
  background: var(--color-border-light);
}

.brand-icon svg {
  width: 32px;
  height: 32px;
}

.brand-refresh-btn {
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.brand-refresh-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.9);
  outline-offset: 2px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.2;
}

.brand-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.02em;
}

.sidebar-topbar {
  height: 48px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  justify-content: space-between;
  margin-bottom: 2px;
  border-radius: 8px;
}

.sidebar-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.topbar-admin-btn {
  display: flex;
  width: 27px;
  height: 25px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #c9d4e0;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-topbar .topbar-admin-btn {
  padding: 0;
  cursor: pointer;
}

.topbar-admin-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.15);
}

.topbar-admin-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.topbar-add-btn {
  appearance: none;
}

.sidebar-topbar .brand-icon svg {
  width: 28px;
  height: 28px;
}

.sidebar-topbar .brand-name {
  font-size: 14px;
}

:root[lang^="en"] .sidebar-topbar .brand-text {
  min-width: 0;
}

:root[lang^="en"] .sidebar-topbar .brand-name {
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}

.sidebar-topbar .brand-sub {
  font-size: 10px;
}

/* Search */
.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 34px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 17px;
  padding: 0 12px 0 34px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.45);
}

.search-box input:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--color-surface-alt);
}

.search-result-item .result-name {
  font-weight: 500;
  color: var(--color-text);
}

.search-result-item .result-path {
  font-size: 11px;
  color: var(--color-text-muted);
}

.search-no-result {
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Top bar buttons */
.btn-edit-toggle, .btn-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-edit-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
}

.btn-edit-toggle:hover, .btn-edit-toggle.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary-dark);
}

.btn-edit-toggle svg, .btn-admin svg {
  width: 12px;
  height: 12px;
}

.btn-admin {
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.3);
  color: var(--color-accent-light);
}

.btn-admin:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary-dark);
}

.main-layout {
  display: flex;
  flex-direction: row;
  height: 100vh;
  margin-top: 0;
  padding: 5px 5px 5px 5px;
  gap: 10px;
  background: var(--color-bg);
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: none;
  position: relative;
  z-index: 10;
  margin: 0;
  flex-shrink: 0;
  height: 100%;
  gap: 2px;
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  z-index: 30;
  width: 10px;
  cursor: ew-resize;
  touch-action: none;
  outline: none;
}

.sidebar-resize-handle::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 4px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background 0.15s ease;
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle:focus-visible::after,
body.sidebar-resizing .sidebar-resize-handle::after {
  background: color-mix(in srgb, var(--color-primary) 55%, transparent);
}

body.sidebar-resizing {
  cursor: ew-resize;
  user-select: none;
}

body.sidebar-resizing iframe {
  pointer-events: none;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  border: none;
  margin-left: 0;
  box-shadow: none;
  overflow: visible;
}

.sidebar.collapsed .sidebar-topbar {
  display: none;
}

.sidebar.collapsed .sidebar-content-wrapper {
  display: none;
}

.sidebar.collapsed .sidebar-resize-handle {
  display: none;
}

.sidebar-content-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-radius: 8px;
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  background: var(--color-surface);
  contain: layout paint;
}

.sidebar-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  flex-shrink: 0;
  padding: 0 4px 0 8px;
}

.sidebar-tab-btns {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.directory-tab-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  direction: ltr;
}

.directory-tab-main {
  padding-left: 5px;
}

.directory-menu-toggle {
  width: 23px;
  min-width: 23px;
  padding: 0 2px 0 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: -1px;
}

.directory-menu-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.18s ease;
}

.directory-tab-wrap:has(.sidebar-tab.active) .directory-menu-toggle {
  color: #fff;
  background: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.directory-tab-wrap:has(.sidebar-tab.active) .directory-tab-main {
  border-radius: 0 6px 0 0;
}

.directory-tab-wrap:has(.sidebar-tab.active) .directory-menu-toggle {
  border-radius: 6px 0 0 0;
  transform: translateY(2px) scale(0.97);
  box-shadow: inset -2px 5px 10px rgba(0,0,0,0.22);
}

.directory-menu-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.directory-menu {
  position: absolute;
  z-index: 10100;
  top: calc(100% + 7px);
  left: 0;
  width: 210px;
  max-width: min(280px, calc(100vw - 28px));
  padding: 6px;
  border: 1px solid var(--color-border-light);
  border-radius: 7px;
  background: var(--color-surface);
  box-shadow: 0 10px 28px rgba(18, 28, 45, 0.18);
}

.directory-menu.directory-menu-portal {
  position: fixed;
  left: auto;
}

.directory-menu-heading {
  padding: 5px 8px 6px;
  color: var(--color-text-muted);
  font-size: 11px;
}

.directory-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.directory-menu-row {
  position: relative;
  display: flex;
  align-items: center;
}

.directory-menu-row > .directory-menu-item {
  min-width: 0;
  padding-right: 34px;
}

body.edit-mode .directory-menu-row > .directory-menu-item {
  padding-right: 62px;
}

.directory-row-action,
.directory-row-share {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-50%);
}

.directory-row-action {
  right: 33px;
}

.directory-menu-row:hover .directory-row-share,
.directory-row-share:focus-visible,
.directory-row-share[aria-expanded="true"],
body.edit-mode .directory-menu-row:hover .directory-row-action,
body.edit-mode .directory-row-action:focus-visible,
body.edit-mode .directory-row-action[aria-expanded="true"] {
  display: flex;
}

.directory-row-action:hover,
.directory-row-action:focus-visible,
.directory-row-share:hover,
.directory-row-share:focus-visible {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  outline: none;
}

.directory-row-action svg,
.directory-row-share svg {
  width: 16px;
  height: 16px;
}

.directory-action-menu {
  position: fixed;
  z-index: 10120;
  width: 132px;
  padding: 5px;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: var(--color-surface);
  box-shadow: 0 9px 24px rgba(18, 28, 45, 0.2);
}

.directory-share-menu {
  position: fixed;
  z-index: 10120;
  width: 132px;
  padding: 5px;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: var(--color-surface);
  box-shadow: 0 9px 24px rgba(18, 28, 45, 0.2);
}

.directory-action-item,
.directory-share-item {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.directory-action-item:hover:not(:disabled),
.directory-action-item:focus-visible:not(:disabled),
.directory-share-item:hover,
.directory-share-item:focus-visible {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  outline: none;
}

.directory-action-item.danger:hover:not(:disabled),
.directory-action-item.danger:focus-visible:not(:disabled) {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.directory-action-item:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.directory-action-item svg,
.directory-share-item svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.directory-menu-item:hover,
.directory-menu-item.active {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
}

.directory-menu-item.locked,
.directory-menu-item.locked:hover {
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-text-muted) 8%, transparent);
  cursor: not-allowed;
  opacity: 0.72;
}

.directory-menu-item.locked.admin-editable,
.directory-menu-item.locked.admin-editable:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  cursor: pointer;
  opacity: 1;
}

.directory-menu-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.directory-menu-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-create-item {
  display: none;
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--color-border-light);
  border-radius: 0 0 4px 4px;
  color: var(--color-primary);
  font-weight: 600;
}

body.edit-mode .directory-create-item {
  display: flex;
}

@media (hover: none), (pointer: coarse) {
  .directory-row-share,
  body.edit-mode .directory-row-action {
    display: flex;
  }
}
.sidebar-edit-add-btn {
  margin: 0;
  color: var(--color-primary, #1a3a5c);
  border: 1px solid var(--color-border-light, #e0e4ea);
  border-radius: 4px;
}
.sidebar-edit-add-btn:hover {
  background: var(--color-primary-light, #e8f0f8);
}

.sidebar-tab-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 9.6px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition), transform 0.1s ease, box-shadow 0.1s ease;
  white-space: nowrap;
  margin-bottom: -1px;
  position: relative;
}

.sidebar-tab:hover {
  color: var(--color-primary-dark);
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
}

.sidebar-tab.active {
  color: #fff;
  background: var(--color-primary);
  border-bottom-color: var(--color-primary);
  border-radius: 6px 6px 0 0;
  font-weight: 600;
  transform: translateY(2px) scale(0.97);
  box-shadow: inset 0 5px 10px rgba(0,0,0,0.4), inset 0 2px 4px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
  z-index: 1;
}

.sidebar-tab.active:hover {
  color: #fff;
  background: var(--color-primary);
  transform: translateY(2px) scale(0.97);
  box-shadow: inset 0 5px 10px rgba(0,0,0,0.4), inset 0 2px 4px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
}

.sidebar-tab-panel {
  background: var(--color-surface);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.plaza-sidebar-panel {
  min-height: 0;
  padding-top: 8px;
}

#panelPlaza .plaza-fixed-article {
  width: 100%;
  height: auto;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  font-family: inherit;
  align-items: flex-start;
  flex-shrink: 0;
}

.plaza-fixed-article .tree-toggle,
.plaza-fixed-article .tree-icon {
  margin-top: 7px;
}

.plaza-fixed-article .tree-node-name {
  min-width: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 20px;
}

#panelPlaza .plaza-fixed-article.active {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

#panelPlaza .plaza-fixed-article:hover {
  background: var(--color-surface-alt);
}

.plaza-fixed-article.active .tree-node-name {
  color: var(--color-primary);
  font-weight: 600;
}

.plaza-sort-menu-wrap {
  position: relative;
  display: flex;
}

.plaza-sort-menu-toggle svg {
  width: 19px;
  height: 19px;
  transform: rotate(90deg);
}

.plaza-sort-menu-toggle {
  width: 31px;
  height: 29px;
  padding: 5px 6px;
  background: #e8f0fe;
  border: 1px solid #c5d5f0;
  border-radius: 5px;
  color: #1a3a5c;
}

.plaza-sort-menu-toggle:hover,
.plaza-sort-menu-toggle.active {
  background: #dce9fc;
  color: #1a3a5c;
}

.sidebar-action-divider {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: #cbd5e1;
  flex: 0 0 1px;
}

.plaza-sort-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: 104px;
  padding: 4px;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(26, 58, 92, 0.16);
}

.plaza-sort-menu[hidden] { display: none; }

.plaza-sort-menu-item {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.plaza-sort-menu-item:hover,
.plaza-sort-menu-item.active {
  color: var(--color-primary);
  background: var(--color-surface-alt);
}

.plaza-sort-menu-item.active { font-weight: 600; }
.plaza-sort-arrow { width: 10px; text-align: center; }

.plaza-refresh-btn,
.plaza-page-refresh {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
}

.plaza-refresh-btn:hover,
.plaza-page-refresh:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  background: var(--color-surface-alt);
}

.plaza-refresh-btn svg,
.plaza-page-refresh svg {
  width: 14px;
  height: 14px;
}

.plaza-sidebar-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

.plaza-sidebar-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}

.plaza-sidebar-item {
  width: 100%;
  height: auto;
  min-height: 32px;
  padding-top: 0;
  padding-right: 8px;
  padding-bottom: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  display: flex;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.plaza-sidebar-item:hover {
  background: var(--color-surface-alt);
}

.plaza-sidebar-folder-row {
  width: 100%;
  height: auto;
  min-height: 32px;
  padding-top: 0;
  padding-right: 8px;
  padding-bottom: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  display: flex;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.plaza-sidebar-folder-row:hover { background: var(--color-surface-alt); }
.plaza-tree-children { min-width: 0; }
.plaza-tree-folder.collapsed > .plaza-tree-children { display: none; }

.plaza-tree-arrow {
  transform: rotate(90deg);
  transition: transform 0.12s ease;
}

.plaza-tree-folder.collapsed > button > .plaza-tree-arrow { transform: rotate(0); }

.plaza-tree-folder-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.plaza-tree-file-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.plaza-sidebar-item .tree-toggle,
.plaza-sidebar-item .tree-icon,
.plaza-sidebar-folder-row .tree-toggle,
.plaza-sidebar-folder-row .plaza-tree-folder-icon,
.plaza-sidebar-folder-row > .plaza-owner-heat {
  margin-top: 7px;
}

.plaza-sidebar-item .tree-node-name,
.plaza-sidebar-folder-row .tree-node-name {
  min-width: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 20px;
}

.plaza-rank {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
}

.plaza-sidebar-file {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plaza-sidebar-name,
.plaza-sidebar-owner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plaza-sidebar-name { font-size: 13px; }
.plaza-sidebar-owner { font-size: 10px; color: var(--color-text-muted); }
.plaza-owner-heat {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.plaza-owner-heat svg {
  width: 16px;
  height: 16px;
}

.sidebar-search-panel {
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  flex-shrink: 0;
  display: none;
}

.sidebar-search-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 4px 8px 12px;
  border-bottom: 1px solid var(--color-border-light);
}

#panelSearch {
  position: relative;
}

.sidebar-search-inner input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--color-text);
  background: transparent;
  font-family: inherit;
}

.sidebar-search-action {
  width: 31px;
  height: 31px;
  padding: 4px 5px;
  border: 1px solid #c5d5f0;
  border-radius: 5px;
  background: #e8f0fe;
  color: #1a3a5c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 31px;
  cursor: pointer;
}

.sidebar-search-clear {
  width: 24px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  cursor: pointer;
}

.sidebar-search-action:hover,
.sidebar-search-action[aria-expanded="true"] {
  background: #dce9fc;
  border-color: #b5c9e8;
  color: #1a3a5c;
}

.sidebar-search-action svg {
  width: 16px;
  height: 16px;
}

.sidebar-search-clear {
  width: 24px;
  height: 26px;
  flex-basis: 24px;
}

.sidebar-search-clear[hidden] {
  display: none;
}

.sidebar-search-clear:hover {
  color: var(--color-text);
}

.sidebar-search-options {
  position: fixed;
  z-index: 9999;
  width: min(310px, calc(100% - 20px));
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.sidebar-search-options[hidden] {
  display: none;
}

.sidebar-search-option-group {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 0 10px;
  border: 0;
}

.sidebar-search-option-group + .sidebar-search-option-group {
  padding-top: 10px;
  padding-bottom: 0;
  border-top: 1px solid var(--color-border-light);
}

.sidebar-search-option-group legend {
  margin-bottom: 7px;
  padding: 0;
  color: var(--color-text-muted);
  font-size: 11px;
}

.sidebar-search-option-group label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.sidebar-search-option-group input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--color-primary);
}

.sidebar-search-location-options {
  display: grid;
  gap: 7px;
}

.search-result-mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #ffdf73;
  color: #172033;
}

.content-search-mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #ffd85c;
  color: #172033;
  box-shadow: 0 0 0 1px rgba(206, 144, 0, 0.18);
}

.content-search-mark-current {
  background: #ffbd3d;
  box-shadow: 0 0 0 2px rgba(206, 112, 0, 0.28);
}

body.shared-mine-readonly #accMyProjects,
body.shared-mine-readonly #accMyFavorites,
body.shared-mine-readonly #accMyDownloads,
body.shared-mine-readonly #accMyFiles .mine-add-btn,
body.shared-mine-readonly #mineDropHint,
body.shared-mine-readonly .mine-folder-add-btn,
body.shared-mine-readonly .mine-sort-handle,
body.shared-mine-readonly .mine-share-cancelled-badge {
  display: none !important;
}

.mine-profile-share-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-primary);
  cursor: pointer;
}

.mine-profile-share-btn:hover {
  background: var(--color-bg-hover);
}

.mine-profile-share-btn svg {
  width: 17px;
  height: 17px;
}

.searchable-text-file-preview {
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 12px 10px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff;
  color: #111827;
  font: 13px/1.55 Consolas, "Courier New", monospace;
}

.text-file-preview-loading {
  padding: 20px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.sidebar-search-option-divider {
  height: 1px;
  margin: 2px 0;
  background: var(--color-border-light);
}

.sidebar-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  max-height: none;
}

.sidebar-search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  transition: var(--transition);
}

.sidebar-search-result-item:hover {
  background: var(--color-surface-alt);
}

.search-result-locate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.sidebar-search-result-item:hover .search-result-locate-btn,
.sidebar-search-result-item:focus-within .search-result-locate-btn,
.search-exclusive-result-item:hover .search-result-locate-btn,
.search-exclusive-result-item:focus-within .search-result-locate-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-result-locate-btn:hover,
.search-result-locate-btn:focus-visible {
  color: #fff;
  border-color: var(--color-primary);
  background: var(--color-primary);
  outline: none;
}

.search-result-locate-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-search-result-item .result-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-search-result-item .result-path-inline,
.search-exclusive-result-path-inline {
  color: var(--color-text-muted);
  font-size: 0.9em;
  font-weight: 400;
}

.sidebar-search-result-icon,
.search-exclusive-result-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.sidebar-search-result-icon svg,
.sidebar-search-result-icon img,
.search-exclusive-result-icon svg,
.search-exclusive-result-icon img {
  display: block;
  width: 100%;
  height: 100%;
}

.sidebar-search-result-item .result-path {
  font-size: 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.sidebar-search-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}

.sidebar-mine-panel {
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  flex-shrink: 0;
  display: none;
}

.sidebar-mine-inner {
  padding: 6px 0;
}

.mine-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  transition: var(--transition);
}

.mine-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

/* Mine panel scroll container */
.mine-panel-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  box-sizing: border-box;
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
}

.mine-section {
  border-bottom: 1px solid var(--color-border-light);
  padding: 4px 0;
}

.mine-actions {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Accordion items (legacy) */
.mine-accordion-item {
  border-bottom: 1px solid var(--color-border-light);
}

.mine-accordion-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.mine-accordion-hd:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.mine-accordion-hd.open {
  color: var(--color-primary-dark);
  background: #f0f9ff;
  font-weight: 600;
}

.mine-accordion-bd {
  /* 资源管理器风格，无背景色区分 */
  padding: 0;
}

/* Tree-style mine sections (v2) */
.mine-tree-section {
  /* 与目录树风格一致，节之间无分隔线 */
}

.mine-fixed-article {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  font-family: inherit;
}

.mine-fixed-article:hover,
.mine-fixed-article.active {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.mine-fixed-article.active .tree-node-name { color: var(--color-primary); font-weight: 600; }
.mine-section-folder-icon { width: 18px; height: 18px; flex: 0 0 18px; }

.fixed-article-edit-icon {
  display: none;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
}

.fixed-article-edit-icon svg {
  width: 15px;
  height: 15px;
}

body.edit-mode .fixed-article-normal-icon { display: none; }
body.edit-mode .fixed-article-edit-icon { display: inline-flex; }

.fixed-article-drag-handle,
.fixed-article-actions {
  display: none;
}

body.edit-mode .fixed-article-drag-handle {
  width: 12px;
  height: 22px;
  flex: 0 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

body.edit-mode .fixed-article-drag-handle svg {
  width: 12px;
  height: 12px;
  opacity: 0.4;
}

body.edit-mode .fixed-article-actions {
  display: flex;
  margin-left: auto;
}

body.edit-mode #panelPlaza .plaza-fixed-article,
body.edit-mode #panelMine .mine-fixed-article {
  padding-left: 4px !important;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding-top: 5px;
  padding-bottom: 5px;
}

body.edit-mode #panelPlaza .plaza-fixed-article > *,
body.edit-mode #panelMine .mine-fixed-article > * {
  margin-top: 0 !important;
}

body.edit-mode #panelPlaza .plaza-fixed-article .tree-node-name,
body.edit-mode #panelMine .mine-fixed-article .tree-node-name {
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

body.edit-mode .plaza-fixed-article:hover .ft-node-plus-btn,
body.edit-mode .mine-fixed-article:hover .ft-node-plus-btn {
  display: inline-flex;
}

body:not(.edit-mode) .fixed-article-meta-hidden {
  display: none !important;
}

body.edit-mode .fixed-article-meta-hidden {
  opacity: 0.5;
}

.unified-node-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  overflow: hidden;
}

.unified-node-icon svg,
.unified-node-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.unified-node-emoji { font-size: 15px; line-height: 1; }
.file-card-icon,
.file-card-icon svg,
.file-card-icon img { width: 24px; height: 24px; }

.unsupported-file-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(480px, 100%);
}

.unsupported-file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.unsupported-file-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
}

.unsupported-file-copy { flex: 1; min-width: 0; }
.unsupported-file-name {
  overflow: hidden;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unsupported-file-meta {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 12px;
}
.unsupported-file-notice {
  margin-top: 4px;
  color: var(--color-warning);
  font-size: 11px;
}
.unsupported-file-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid var(--color-primary-light);
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

:root[data-color-mode="dark"] .unsupported-file-card {
  border-color: #596777;
  background: #202731;
  box-shadow: 0 8px 22px rgb(0 0 0 / 28%);
}
:root[data-color-mode="dark"] .unsupported-file-icon {
  border-color: #465361;
  background: #2a333e;
  color: #b9c5d2;
}
:root[data-color-mode="dark"] .unsupported-file-name { color: #f2f6fa; }
:root[data-color-mode="dark"] .unsupported-file-meta { color: #b5c0cc; }
:root[data-color-mode="dark"] .unsupported-file-notice { color: #fbbf24; }
:root[data-color-mode="dark"] .unsupported-file-download {
  border-color: #6da7e8;
  background: #24558a;
  color: #fff;
}

.mine-tree-hd {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 0;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  min-height: 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.mine-tree-hd:hover {
  background: var(--color-surface-alt);
}

.mine-tree-hd.open {
  /* 展开状态不改变背景，与目录树风格一致 */
}

/* 与目录根文件夹使用相同的 16px 箭头占位，使后续图标左边缘完全一致。 */
.mine-tree-hd > .mine-acc-arrow {
  width: 16px !important;
  height: 16px !important;
  padding: 2px;
  box-sizing: border-box;
}

.mine-tree-label {
  flex: 1;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.mine-section-count {
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

/* + Add button on section header */
.mine-add-btn {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 3px;
  font-size: 15px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
  margin-left: auto;
  opacity: 0;
}

.mine-tree-hd:hover .mine-add-btn {
  opacity: 1;
}

.mine-add-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

/* Add dropdown menu */
.mine-add-menu {
  position: absolute;
  right: 8px;
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  min-width: 130px;
}

.mine-add-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  white-space: nowrap;
}

.mine-add-menu-item:hover {
  background: #f0f9ff;
  color: var(--color-primary-dark);
}

.mine-add-menu-item + .mine-add-menu-item {
  border-top: 1px solid var(--color-border-light);
}

/* Folder list inside accordion (资源管理器风格，紧凑) */
.mine-folder-list {
  padding: 0;
}

.mine-folder-group {
  margin: 0;
}

.mine-folder-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text);
  transition: var(--transition);
}

.mine-folder-row:hover {
  background: var(--color-surface);
  color: var(--color-primary);
}

.mine-folder-row.open {
  color: var(--color-primary-dark);
  background: #e0f2fe;
}

.mine-folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.mine-folder-count {
  font-size: 10px;
  color: var(--color-text-muted);
  background: var(--color-border-light);
  border-radius: 10px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.mine-folder-content {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  padding: 4px 0;
}

.mine-folder-actions {
  padding: 4px 10px 6px;
  display: flex;
  gap: 6px;
}

.mine-folder-act-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  font-size: 11px;
  font-family: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.mine-folder-act-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 4%, transparent);
}

.mine-add-folder-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 20px);
  margin: 6px 10px;
  padding: 7px 12px;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.mine-add-folder-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: #f0f9ff;
}

/* Root-level action buttons (新建文件夹 + 上传文件) */
.mine-root-actions {
  display: flex;
  gap: 6px;
  padding: 6px 10px 8px;
  border-top: 1px solid var(--color-border-light);
}

.mine-root-act-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  font-size: 11px;
  font-family: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.mine-root-act-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: #f0f9ff;
}

/* Folder row v2 (图2 style) */
.mine-folder-row2 {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 7px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  transition: var(--transition);
  background: var(--color-surface);
}

.mine-folder-row2:hover {
  background: #f0f9ff;
  color: var(--color-primary-dark);
}

.mine-folder-row2.open {
  color: var(--color-primary-dark);
  background: #e0f2fe;
}

.mine-folder-del {
  background: none;
  border: 1px solid var(--color-border-light);
  border-radius: 3px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
}

.mine-folder-del:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Folder content v2 */
.mine-folder-content2 {
  background: #f8fafc;
  border-top: 1px solid var(--color-border-light);
}

/* File row inside folder */
.mine-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 20px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--color-border-light);
}

.mine-file-row:hover {
  background: #e0f2fe;
}

.mine-file-badge {
  width: 34px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
  color: #fff;
}

/* Folder action buttons (inside folder content) */
.mine-folder-btns {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
}

.mine-folder-act-btn2 {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  font-size: 11px;
  font-family: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.mine-folder-act-btn2:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: #f0f9ff;
}

/* 树状目录 - 参考图风格 */

/* 树节点容器 */
/* ===== 我的板块树形菜单（与前台目录树完全一致） ===== */
.mine-tree-node {
  user-select: none;
}

/* 子节点容器（与前台目录树一致，无竖线） */
.mine-tree-children {
  overflow: hidden;
}

/* 文件夹行（与 .tree-node-row 完全一致） */
.mine-tree-folder-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 0;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background 0.15s;
  position: relative;
  min-height: 32px;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text);
  user-select: none;
}

.mine-tree-folder-row:hover {
  background: var(--color-surface-alt);
}

.mine-tree-folder-row.open {
  /* 展开状态无特殊背景，与前台目录树一致 */
}

.mine-tree-folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}

/* 展开箭头（与 .tree-toggle 完全一致） */
.mine-tree-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mine-tree-arrow.open {
  transform: rotate(90deg);
}

.mine-tree-arrow-placeholder {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  visibility: hidden;
}

/* 文件行（与 .tree-node-row 完全一致） */
.mine-tree-file-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 0;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background 0.15s;
  position: relative;
  min-height: 32px;
  font-size: 13px;
  color: var(--color-text);
  user-select: none;
}

.mine-tree-file-row:hover {
  background: var(--color-surface-alt);
}

.mine-tree-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}

.mine-files-load-more {
  display: block;
  width: calc(100% - 48px);
  min-height: 30px;
  margin: 5px 12px 7px 36px;
  border: 1px solid #d7dee8;
  border-radius: 5px;
  background: #f8fafc;
  color: #36536f;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.mine-files-load-more:hover {
  border-color: #9db1c5;
  background: #eef3f8;
}

.mine-files-page-status {
  min-height: 30px;
  padding: 7px 12px 7px 40px;
  color: #7b8794;
  font-size: 12px;
}

/* 删除按钮（与前台目录树操作按钮一致） */
.mine-tree-del-btn {
  background: none;
  border: none;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  border-radius: 3px;
}

.mine-tree-folder-row:hover .mine-tree-del-btn,
.mine-tree-file-row:hover .mine-tree-del-btn {
  opacity: 1;
}

.mine-tree-del-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}

.mine-tree-share-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
}

.mine-tree-share-btn svg {
  width: 13px;
  height: 13px;
}

.mine-tree-file-row:hover .mine-tree-share-btn,
.mine-tree-folder-row:hover .mine-tree-share-btn {
  opacity: 1;
}

.mine-tree-share-btn.active { opacity: 0; }

.mine-tree-share-btn:hover,
.mine-tree-share-btn.active {
  color: #047857;
  background: #ecfdf5;
}

/* 兼容旧类名 */
.mine-tree-indent { position: relative; }
.mine-tree-item { position: relative; }

/* 文件夹行内加号按钮（与前台目录树一致） */
.mine-folder-add-btn {
  background: none;
  border: none;
  border-radius: 3px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
  opacity: 0;
}

.mine-folder-row2:hover .mine-folder-add-btn,
.mine-tree-folder-row:hover .mine-folder-add-btn,
.mine-tree-file-row:hover .mine-file-action-btn {
  opacity: 1;
}

.mine-folder-add-btn:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #16a34a;
}

/* 文件夹行内加号菜单（复用 mine-add-menu 样式，仅覆盖定位） */
.mine-folder-add-menu {
  position: absolute;
  z-index: 300;
  overflow: visible;
}

.mine-folder-add-menu .ft-menu-submenu-panel {
  z-index: 1;
}

.mine-add-menu-item:disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.mine-share-cancelled-badge {
  flex: 0 0 auto;
  padding: 1px 4px;
  border: 1px solid #fecaca;
  border-radius: 3px;
  background: #fff7f7;
  color: #b91c1c;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
}

.mine-node-state-badge {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
}

.mine-node-hidden-badge {
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.mine-node-locked-badge {
  border: 1px solid rgba(180, 83, 9, 0.2);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

body.edit-mode #mineFolderList .mine-node-hidden {
  opacity: 0.55;
}

#mineFolderList .mine-node-locked:not(.ft-edit-row) {
  cursor: not-allowed;
}

.mine-add-menu-item.mine-add-menu-danger {
  color: #b91c1c;
}

.mine-add-menu-item.mine-add-menu-danger:hover {
  background: #fef2f2;
  color: #991b1b;
}

.mine-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.mine-action-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.mine-action-btn:hover svg {
  stroke: #fff;
}

/* Mine sub panels */
.mine-sub-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mine-sub-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  flex-shrink: 0;
}

.mine-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  border-radius: 3px;
  transition: var(--transition);
}

.mine-back-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

/* Upload area */
.mine-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px;
  padding: 20px 12px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  color: var(--color-text-muted);
}

.mine-upload-area:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 4%, transparent);
  color: var(--color-primary);
}

.mine-upload-area p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.mine-upload-area small {
  font-size: 11px;
  color: var(--color-text-muted);
}

.mine-upload-list {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mine-upload-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--color-text);
}

.mine-upload-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-upload-item .file-size {
  color: var(--color-text-muted);
  font-size: 11px;
  flex-shrink: 0;
}

.mine-upload-item .file-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--color-text-muted);
  display: flex;
  flex-shrink: 0;
  border-radius: 3px;
  transition: var(--transition);
}

.mine-upload-item .file-remove:hover {
  color: var(--color-danger);
  background: rgba(220,38,38,0.08);
}

/* Favorites list */
.mine-favorites-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.mine-favorite-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  transition: var(--transition);
  border-bottom: 1px solid var(--color-border-light);
}

.mine-favorite-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.mine-favorite-item .fav-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-favorite-item .fav-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--color-text-muted);
  display: flex;
  flex-shrink: 0;
  border-radius: 3px;
  opacity: 0;
  transition: var(--transition);
}

.mine-favorite-item:hover .fav-remove {
  opacity: 1;
}

.mine-favorite-item .fav-remove:hover {
  color: var(--color-danger);
}

.mine-empty {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}

.mine-section-hint {
  padding: 6px 8px 6px 50px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 20px;
  text-align: left;
}

.mine-projects-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* My Files panel */
.mine-files-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mine-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.mine-file-item:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border-light);
}

.mine-file-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}

.mine-file-info {
  flex: 1;
  overflow: hidden;
}

.mine-file-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-file-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* Small action button in sub-panel header */
.mine-action-btn-sm {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  font-size: 11px;
  font-family: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.mine-action-btn-sm:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.sidebar-collapse-btn {
  background: #e8f0fe;
  border: 1px solid #c5d5f0;
  color: #1a3a5c;
  cursor: pointer;
  padding: 4.8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-collapse-all-btn {
  width: 31px;
  height: 29px;
  padding: 4px 5px;
  margin-right: 3px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.sidebar-collapse-all-btn:hover,
.sidebar-collapse-all-btn.active {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
}

.sidebar-collapse-all-btn svg {
  width: 19px;
  height: 19px;
}

.tree-collapse-divider {
  margin: 0 4px 0 1px;
}

/* 侧边栏Tab行图标按钮 */
.sidebar-icon-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.sidebar-icon-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
}
.sidebar-icon-btn.active,
.sidebar-icon-btn.btn-edit-toggle.active {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.sidebar-collapse-btn:hover {
  background: #1a3a5c;
  color: #fff;
}

.sidebar-collapse-btn svg {
  width: 19.2px;
  height: 19.2px;
}

/* TOC header bar with + button */
.toc-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 4px 12px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  flex-shrink: 0;
  min-height: 30px;
}

.toc-header-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1;
}

.toc-header-actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.sidebar-tree {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.sidebar-tree::-webkit-scrollbar {
  width: 9px;
}

.sidebar-tree::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-tree::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 7px;
}

/* Sidebar footer - bottom action buttons */
.sidebar-footer {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.sidebar-footer .btn-edit-toggle,
.sidebar-footer .btn-admin {
  flex: 1;
  justify-content: center;
  padding: 4px 4px;
  font-size: 11px;
  border-radius: var(--radius);
  min-width: 0;
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
  color: var(--color-primary-dark);
}

/* Expand / Collapse all tree buttons */
.btn-tree-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 4px 4px;
  font-size: 11px;
  font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
  color: var(--color-primary-dark);
  min-width: 0;
}

.btn-tree-expand:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn-tree-expand svg {
  flex-shrink: 0;
}

.sidebar-file-nav-btn {
  width: 26px;
  height: 28px;
  padding: 4px 3px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-file-nav-btn:hover:not(:disabled) {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.sidebar-file-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.sidebar-file-nav-btn svg {
  width: 19.2px;
  height: 19.2px;
  flex-shrink: 0;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer .btn-edit-toggle {
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
  color: var(--color-primary-dark);
}

.sidebar-footer .btn-edit-toggle:hover,
.sidebar-footer .btn-edit-toggle.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.sidebar-footer .btn-admin {
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
  color: var(--color-primary-dark);
}

.sidebar-footer .btn-admin:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Sidebar collapsed indicator */
.sidebar-collapsed-indicator {
  width: 0;
  position: relative;
  flex-shrink: 0;
  margin-left: 0;
}

.sidebar-expand-btn {
  position: fixed;
  top: 8px;
  left: 0;
  height: 40px;
  background: #e8f0fe;
  border: 1px solid #c5d5f0;
  color: #1a3a5c;
  cursor: pointer;
  padding: 0 8px;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 2px 0 8px rgba(0,0,0,0.18);
  z-index: 300;
}

.sidebar-expand-btn:hover {
  background: #1a3a5c;
  color: #fff;
}

.sidebar-expand-btn svg {
  width: 16px;
  height: 16px;
}

.tree-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.tree-node {
  user-select: none;
}

.tree-node-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 0;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background 0.15s;
  position: relative;
  min-height: 32px;
}

.tree-node-row:hover {
  background: var(--color-surface-alt);
}

.tree-node-row.active {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.tree-node-row.active .tree-node-name {
  color: var(--color-primary);
  font-weight: 600;
}

.tree-node-row.edited::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-edited);
}

.tree-toggle {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.tree-toggle svg {
  width: 12px;
  height: 12px;
}

.tree-toggle.open {
  transform: rotate(90deg);
}

.tree-toggle.leaf {
  visibility: hidden;
}

.tree-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.tree-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.tree-icon svg {
  width: 16px;
  height: 16px;
}

.tree-node-name {
  font-size: 13px;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

/* 目录名称较长时完整换行展示，操作按钮保持在行尾。 */
#sidebarTree .tree-node-row,
#plazaSidebarList .tree-node-row,
#panelMine .mine-fixed-article,
#panelMine .mine-tree-hd,
#panelMine .mine-tree-folder-row,
#panelMine .mine-tree-file-row,
#panelMine .mine-download-row {
  height: auto;
  min-height: 32px;
  align-items: flex-start;
  gap: 4px;
  padding-top: 0;
  padding-bottom: 0;
}

#sidebarTree .tree-toggle,
#sidebarTree .tree-icon,
#sidebarTree .tree-plus-btn,
#plazaSidebarList .tree-toggle,
#plazaSidebarList .tree-icon,
#plazaSidebarList .plaza-clicks,
#panelMine .mine-fixed-article > :not(.tree-node-name),
#panelMine .mine-tree-hd > :not(.mine-tree-label),
#panelMine .mine-tree-folder-row > :not(.mine-tree-folder-name),
#panelMine .mine-tree-file-row > :not(.mine-tree-file-name),
#panelMine .mine-download-row > :not(.mine-download-info) {
  margin-top: 7px;
}

#sidebarTree .tree-node-name,
#plazaSidebarList .tree-node-name,
#panelMine .mine-fixed-article .tree-node-name,
#panelMine .mine-tree-label,
#panelMine .mine-tree-folder-name,
#panelMine .mine-tree-file-name,
#panelMine .mine-download-info {
  min-width: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 20px;
}

.tree-children {
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-children.collapsed {
  max-height: 0 !important;
}

.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
  border: none;
  border-radius: 0;
  box-shadow: none;
  align-self: stretch;
  padding: 0 0 0 0;
  gap: 0;
  position: relative;
}

/* 内容展示卡片（默认 950px，可在当前页面中拖动调整） */
.content-area-inner {
  width: min(var(--desktop-content-width), 100%);
  max-width: none;
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  align-self: flex-start;
  height: 100%;
  align-self: stretch;
}

.content-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: min(var(--desktop-content-width), 100%);
  z-index: 30;
  width: 10px;
  transform: translateX(-5px);
  cursor: ew-resize;
  touch-action: none;
  outline: none;
}

.content-resize-handle::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background 0.15s ease;
}

.content-resize-handle:hover::after,
.content-resize-handle:focus-visible::after,
body.content-resizing .content-resize-handle::after {
  background: color-mix(in srgb, var(--color-primary) 55%, transparent);
}

body.content-resizing {
  cursor: ew-resize;
  user-select: none;
}

body.content-resizing iframe {
  pointer-events: none;
}

.content-area-fullscreen .content-resize-handle {
  display: none;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0 30px 0 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  font-size: 12px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  min-height: 36px;
  width: 100%;
  justify-content: space-between;
  box-sizing: border-box;
}

.breadcrumb-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.breadcrumb-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.breadcrumb-item:not(:last-child)::after {
  content: '›';
  color: var(--color-border);
  font-size: 15px;
  margin-left: 4px;
  line-height: 1;
}

.breadcrumb-item.active {
  color: var(--color-text);
  font-weight: 500;
}

.breadcrumb-item a,
.breadcrumb-folder-link {
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.breadcrumb-folder-link {
  border: 0;
  background: transparent;
  font: inherit;
}

.breadcrumb-item a:hover,
.breadcrumb-folder-link:hover {
  color: var(--color-primary);
  background: var(--color-surface-alt);
}

#sidebarTree .ft-edit-row.active,
#mineFolderList .mine-tree-folder-row.active {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.breadcrumb-home-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.breadcrumb-home-icon:hover {
  color: var(--color-primary);
  background: var(--color-surface-alt);
}

/* Content Toolbar */
.content-toolbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* 富文本工具栏布局 */
.rich-toolbar {
  flex-direction: column;
  align-items: stretch;
  padding: 4px 12px;
  gap: 0;
}

.rich-toolbar .toolbar-row {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 3px 0;
}

.rich-toolbar .toolbar-actions {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.rich-toolbar {
  position: relative;
}

/* 工具栏按钒激活状态 */
.toolbar-btn.active {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
  color: var(--color-primary);
}

/* 颜色按钒 */
.color-btn {
  position: relative;
  overflow: visible;
}

/* 全屏编辑 */
#pageContent.editor-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#pageContent.editor-fullscreen .editable-content {
  flex: 1;
  overflow-y: auto;
  min-height: unset;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.toolbar-btn:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  color: var(--color-text);
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 4px;
}

.toolbar-select {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  cursor: pointer;
  outline: none;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-save, .btn-reset {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-save {
  background: var(--color-primary);
  color: #fff;
}

.btn-save:hover {
  background: var(--color-primary-light);
}

.btn-reset {
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-reset:hover {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.btn-save svg, .btn-reset svg {
  width: 14px;
  height: 14px;
}

/* Page Content */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-content::-webkit-scrollbar {
  width: 12px;
}

.page-content::-webkit-scrollbar-track {
  background: transparent;
}

.page-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 6px;
}
/* Page title bar (inside content area) */
.page-title-bar {
  display: none !important;
}

.page-title-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

/* Welcome Screen */
.homepage-config-pending {
  visibility: hidden;
}

.welcome-screen {
  max-width: 680px;
  margin: 60px auto;
  padding: 0 24px;
  text-align: center;
}

.welcome-logo {
  margin-bottom: 24px;
}

.welcome-logo svg {
  width: 80px;
  height: 80px;
}

.welcome-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.welcome-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.welcome-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.welcome-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.welcome-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}

/* 固定统计栏 - 始终显示在内容区顶部 */
.content-stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 16px 20px;
  margin-top: 24px;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.65em;
  line-height: 1.65;
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
}

.rolling-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.rolling-digit {
  display: inline-block;
  height: 1.15em;
  line-height: 1.15em;
  min-width: 0.62em;
  overflow: hidden;
  text-align: center;
  vertical-align: bottom;
}

.rolling-digit-strip {
  display: flex;
  flex-direction: column;
  transform: translateY(var(--roll-end, -50%));
  will-change: transform;
  backface-visibility: hidden;
  animation: numberRollUp 880ms cubic-bezier(.22, .75, .25, 1) both;
}

.rolling-digit-face {
  display: block;
  flex: 0 0 1.15em;
  height: 1.15em;
  line-height: 1.15em;
}

@keyframes numberRollUp {
  0%, 12% { transform: translateY(0); }
  88%, 100% { transform: translateY(var(--roll-end, -50%)); }
}

@media (prefers-reduced-motion: reduce) {
  .rolling-digit-strip {
    animation: none;
  }
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.locked-node-page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--color-surface);
  text-align: center;
}

.locked-node-page p {
  margin: 0;
  color: var(--color-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.7;
}

.ft-locked-badge {
  flex-shrink: 0;
  padding: 1px 5px;
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  font-size: 10px;
  line-height: 1.4;
}

/* Content Frame */
.content-frame-wrapper {
  background: var(--color-surface);
  min-height: 100%;
}

.content-frame-wrapper iframe {
  width: 100%;
  min-height: 100%;
  border: none;
  display: block;
}

.vendor-help-frame-wrapper {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.vendor-help-frame-wrapper .vendor-help-iframe {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

/* Content frame: wraps original HTML file content with scoped styles */
.sjqy-content-frame {
  display: block;
  width: 100%;
  overflow-x: auto;
}

/* Editable content */
.editable-content {
  background: var(--color-surface);
  min-height: calc(100vh - 80px);
  padding: 28px 36px;
  outline: none;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
}

.editable-content:focus {
  outline: none;
}

.editable-content[contenteditable="true"] {
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-danger);
}

.toast.warning {
  background: var(--color-warning);
}

.toast.directory-maintenance-toast {
  top: var(--directory-toast-top, 88px);
  left: var(--directory-toast-left, calc(var(--sidebar-width) + 16px));
  right: auto;
  bottom: auto;
  transform: translateY(-12px);
  max-width: min(360px, calc(100vw - 32px));
  box-shadow: 0 10px 26px rgba(88, 57, 8, 0.24);
  z-index: 10130;
}

.toast.directory-maintenance-toast.show {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .toast.directory-maintenance-toast {
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    text-align: center;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

body.system-announcement-open {
  overflow: hidden;
}

.system-announcement-overlay {
  z-index: 2000;
}

.system-announcement-overlay[hidden] {
  display: none;
}

.system-announcement-modal {
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: min(78vh, 720px);
}

.system-announcement-body {
  min-height: 180px;
}

.system-announcement-content {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.system-announcement-content > :first-child {
  margin-top: 0;
}

.system-announcement-content > :last-child {
  margin-bottom: 0;
}

.system-announcement-content img,
.system-announcement-content video {
  max-width: 100%;
  height: auto;
}

.system-announcement-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 680px) {
  .system-announcement-modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: 84vh;
  }

  .system-announcement-modal .modal-header,
  .system-announcement-body {
    padding-left: 14px;
    padding-right: 14px;
  }
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  gap: 12px;
}

.icon-target-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.btn-cancel {
  padding: 7px 16px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.btn-cancel:hover {
  background: var(--color-border);
}

/* Icon Picker */
.icon-picker-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.tab-btn:hover:not(.active) {
  color: var(--color-text);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.icon-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

.icon-grid-item:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.icon-grid-item.selected {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.icon-grid-item .icon-preview {
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.icon-grid-item .icon-preview svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.icon-grid-item .icon-preview img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Upload area */
.upload-area {
  margin-bottom: 16px;
}

.upload-placeholder {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
}

.upload-placeholder:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 3%, transparent);
  color: var(--color-primary);
}

.upload-placeholder svg {
  width: 32px;
  height: 32px;
}

.upload-placeholder span {
  font-size: 14px;
  font-weight: 500;
}

.upload-placeholder small {
  font-size: 12px;
}

.uploaded-icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.uploaded-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.uploaded-icon-item:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-alt);
}

.uploaded-icon-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.uploaded-icon-item .icon-filename {
  font-size: 10px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.uploaded-icon-item .icon-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}

.uploaded-icon-item:hover .icon-delete {
  display: flex;
}

@media (max-width: 768px) {
  .brand-sub { display: none; }
  .btn-edit-toggle span, .btn-admin span { display: none; }
  .topbar-center { max-width: 200px; }
  .sidebar { position: absolute; top: 0; left: 0; height: 100%; z-index: 50; box-shadow: var(--shadow-lg); }
  .sidebar.collapsed { transform: translateX(-100%); width: var(--sidebar-width); min-width: var(--sidebar-width); }
  .editable-content { padding: 20px 16px; }
}

/* Mobile reading layout and touch targets */
@media (max-width: 768px) {
  :root { --sidebar-width: min(88vw, 320px); }

  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .main-layout {
    width: 100%;
    height: 100dvh;
    min-height: 100vh;
    padding: 0;
    gap: 0;
  }

  .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: 88vw;
    z-index: 10003;
    border-radius: 0;
    background: var(--color-surface);
    transition: transform 0.22s ease;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .sidebar-resize-handle {
    display: none;
  }

  .sidebar.collapsed {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    transform: translateX(-100%);
  }

  .sidebar-topbar,
  .sidebar-content-wrapper {
    border-radius: 0;
  }

  .sidebar-topbar {
    height: 52px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .sidebar-topbar .brand-sub {
    display: block;
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .sidebar-search-location-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .sidebar-search-options {
    z-index: 10006;
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
  }

  .node-action-menu,
  .ft-node-menu,
  .mine-add-menu,
  .mine-folder-add-menu {
    z-index: 10006;
  }

  .mobile-directory-menu {
    z-index: 10007 !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-directory-submenu {
    z-index: 10008 !important;
    min-width: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  .mobile-directory-submenu .node-action-item {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .content-area,
  .content-area-inner {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .content-resize-handle {
    display: none;
  }

  .content-area {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  .sidebar-collapsed-indicator {
    position: fixed;
    left: max(6px, env(safe-area-inset-left, 0));
    top: max(8px, env(safe-area-inset-top, 0));
    z-index: 10002;
  }

  /* Captures taps on content rendered by iframes while the directory is open. */
  .mobile-sidebar-dismiss-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: transparent;
    touch-action: pan-y;
  }

  .mobile-sidebar-dismiss-overlay[hidden] {
    display: none !important;
  }

  /* Touch surface used when the sidebar is collapsed. It stays above every
     file preview, including fullscreen iframes, while forwarding ordinary
     taps to the underlying page. */
  .mobile-sidebar-swipe-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: max(44px, env(safe-area-inset-left, 0px));
    z-index: 10001;
    background: transparent;
    touch-action: pan-y;
  }

  .mobile-sidebar-swipe-overlay[hidden] {
    display: none !important;
  }

  .sidebar-expand-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: #e8f0fe;
    border: 1px solid #c5d5f0;
    color: #1a3a5c;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.16);
  }

  .sidebar-expand-btn:hover,
  .sidebar-expand-btn:active {
    background: #dce9fc;
    color: #1a3a5c;
  }

  .tree-node-row,
  .plaza-sidebar-item,
  .plaza-sidebar-folder-row,
  .mine-tree-folder-row,
  .mine-tree-file-row,
  .mine-tree-hd,
  .sidebar-search-result-item {
    min-height: 42px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(26, 58, 92, 0.12);
    -webkit-touch-callout: none;
  }

  .mobile-touch-selected {
    background: var(--color-surface-alt) !important;
    color: var(--color-primary) !important;
  }

  #mineFavoritesList .mine-tree-folder-row.mobile-touch-selected .mine-tree-del-btn,
  #mineFavoritesList .mine-tree-file-row.mobile-touch-selected .mine-tree-del-btn {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-search-result-item.mobile-touch-selected .search-result-locate-btn {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  [draggable="false"] {
    -webkit-user-drag: none;
  }

  .breadcrumb {
    min-height: 42px;
    padding: 0 8px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .breadcrumb::-webkit-scrollbar { display: none; }
  .breadcrumb-path { min-width: 90px; flex-wrap: nowrap; }
  .breadcrumb-file-info { gap: 4px; margin-left: 4px; }
  .file-meta-date { display: none; }

  .editable-content,
  .docfile-note-display,
  .mine-file-note-display,
  .mine-file-note-display-bottom {
    padding-left: 14px !important;
    padding-right: 14px !important;
    overflow-wrap: anywhere;
  }

  .welcome-screen {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 28px 14px 32px;
    scroll-margin-top: 8px;
    overflow-x: hidden;
  }

  .welcome-screen img,
  .editable-content img,
  #pageContent img {
    max-width: 100%;
    height: auto;
  }

  .content-stats-bar,
  .welcome-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 16px 8px;
    padding: 14px 8px;
  }

  .content-stats-bar .stat-item,
  .welcome-stats .stat-item {
    width: 100%;
    min-width: 0;
  }

  .stat-num { font-size: 24px; }
  .stat-label { text-align: center; overflow-wrap: anywhere; }

  #sidebarTree .tree-plus-btn {
    min-width: 28px;
    min-height: 28px;
    opacity: 1;
  }

  /* Directory actions stay quiet on mobile until their row is selected.
     Visibility preserves the button width so labels do not shift. */
  #sidebarTree .tree-node-row .tree-plus-btn {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  #sidebarTree .tree-node-row.active .tree-plus-btn,
  #sidebarTree .tree-node-row.mobile-touch-selected .tree-plus-btn {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .ft-edit-row .ft-node-actions {
    display: flex;
  }

  .ft-edit-row .ft-node-plus-btn {
    display: inline-flex;
    width: 28px;
    height: 28px;
  }
}

/* ===== TREE PLUS BUTTON ===== */
.tree-plus-btn {
  opacity: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.tree-node-row:hover .tree-plus-btn {
  opacity: 1;
}

.tree-plus-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

.tree-plus-btn svg {
  width: 11px;
  height: 11px;
}

/* ===== NODE ACTION MENU (加号菜单) ===== */
.node-action-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 140px;
  padding: 4px 0;
  animation: menuFadeIn 0.1s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.node-action-menu-title {
  font-size: 11px;
  color: #8a95a8;
  padding: 5px 12px 3px;
  font-weight: 500;
  border-bottom: 1px solid #f0f2f5;
  margin-bottom: 2px;
}

.node-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  background: none;
  border: none;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  white-space: nowrap;
}

.node-action-item:hover {
  background: #f0f4ff;
  color: var(--color-primary);
}

.node-project-pick-menu {
  max-height: 220px;
  overflow-y: auto;
}

.node-project-pick-modal {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 4px 0;
  max-height: 280px;
  overflow-y: auto;
  animation: menuFadeIn 0.12s ease;
}

/* Added only by the mobile positioning helpers, including iOS Safari modes
   whose layout viewport can be wider than the mobile media-query threshold. */
.mobile-directory-menu {
  z-index: 10007 !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-directory-submenu {
  z-index: 10008 !important;
  min-width: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-directory-submenu .node-action-item {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.node-project-new-btn {
  color: var(--color-primary) !important;
  font-weight: 500;
}

.node-project-new-btn:hover {
  background: rgba(26,58,92,0.06) !important;
}

.node-project-divider {
  height: 1px;
  background: #f0f2f5;
  margin: 3px 0;
}

/* ===== FILE META BAR (面包屑文件信息) ===== */
.file-meta-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.file-meta-tag {
  font-size: 11px;
  font-weight: 600;
  color: #1a3a5c;
  background: rgba(26,58,92,0.08);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

.file-meta-sep {
  font-size: 11px;
  color: #c4cad4;
}

.file-meta-size {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}

.file-meta-date {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}

.file-download-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: #1a3a5c;
  color: #fff;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
  white-space: nowrap;
}

.file-download-btn:hover {
  background: #1e4976;
}

.breadcrumb-file-info .file-download-btn.content-icon-action {
  width: 31px;
  height: 29px;
  padding: 5px 7px;
  justify-content: center;
  gap: 0;
  background: #e8f0fe;
  color: #1a3a5c;
  border: 1px solid #c5d5f0;
}

.breadcrumb-file-info .file-download-btn.content-icon-action:hover {
  background: #1a3a5c;
  color: #fff;
}

.content-icon-action svg,
.file-fullscreen-btn > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.file-reupload-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: #fff;
  color: #1a3a5c;
  border: 1px solid #1a3a5c;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.file-reupload-btn:hover {
  background: #1a3a5c;
  color: #fff;
}
/* 全屏按钮 */
.file-fullscreen-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: #e8f0fe;
  color: #1a3a5c;
  border: 1px solid #c5d5f0;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.breadcrumb-file-info .file-fullscreen-btn:not(.toc-file-nav-btn) {
  width: 31px;
  height: 29px;
  padding: 5px 7px;
  justify-content: center;
  gap: 0;
}
.file-fullscreen-btn:hover {
  background: #1a3a5c;
  color: #fff;
}

.toc-file-nav-btn {
  width: 31px;
  height: 29px;
  padding: 5px 7px;
  justify-content: center;
  gap: 0;
}

.toc-file-nav-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toc-file-nav-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.toc-file-nav-btn:disabled:hover {
  background: #e8f0fe;
  color: #1a3a5c;
}

/* Separate fullscreen from section navigation actions. */
.content-nav-divider {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: #cbd5e1;
  flex: 0 0 1px;
}

/* 全屏模式：内容区横向充满屏幕 */
.content-area-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: var(--color-bg) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* 全屏模式下面包屑展开/收起按钮 */
.fullscreen-breadcrumb-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 22px;
  background: var(--color-surface, #fff);
  border: none;
  border-bottom: 1px solid var(--color-border-light, #e0e4ea);
  cursor: pointer;
  color: var(--color-text-muted, #8a95a8);
  flex-shrink: 0;
  transition: background 0.15s;
}
.fullscreen-breadcrumb-toggle:hover {
  background: var(--color-hover, #f0f4f8);
  color: var(--color-primary, #1a3a5c);
}
.content-area-fullscreen .content-area-inner {
  max-width: 100% !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
}


/* ============================================================
   前台编辑模式目录树样式
   ============================================================ */

.ft-edit-node {
  font-size: 13px;
  color: var(--color-text);
}

/* Cover preview shown above each covered node in the editable tree. */
.ft-edit-cover {
  padding: 3px 8px 2px 24px;
  line-height: 0;
  overflow: hidden;
  text-align: left;
}
.ft-edit-cover img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  cursor: pointer;
}

.ft-edit-toggle {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.ft-edit-toggle.open {
  transform: rotate(90deg);
}

.ft-edit-toggle.leaf {
  visibility: hidden;
}

.ft-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.ft-edit-row:hover {
  background: var(--color-surface-alt);
}

.tree-separator-row {
  display: flex;
  align-items: center;
  min-height: 22px;
  box-sizing: border-box;
}

.tree-separator-content {
  display: grid;
  align-items: center;
  width: 100%;
  min-width: 0;
  row-gap: 2px;
  color: #687386;
}

.tree-separator {
  display: block;
  width: 100%;
  height: 0;
  border-top: 1px solid #c7cdd6;
  box-sizing: border-box;
}

.tree-separator-dashed {
  border-top-style: dashed;
}

.tree-separator-dotted {
  border-top-style: dotted;
  border-top-width: 2px;
}

.tree-separator-double {
  height: 4px;
  border-top: 1px solid #c7cdd6;
  border-bottom: 1px solid #c7cdd6;
}

.tree-separator-short {
  width: 46%;
  margin-left: auto;
  margin-right: auto;
}

.tree-separator-fade {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, #9aa8b9 18%, #9aa8b9 82%, transparent);
}

.tree-separator-accent {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a3a5c, #c66b4e);
}

.tree-separator-beaded {
  height: 4px;
  border: 0;
  background: radial-gradient(circle, #8999ad 1.35px, transparent 1.55px) 0 50% / 8px 4px repeat-x;
}

.tree-separator-rail {
  height: 4px;
  border: 0;
  background:
    linear-gradient(#aab5c3, #aab5c3) 0 0 / 100% 1px no-repeat,
    linear-gradient(#d4dae2, #d4dae2) 0 3px / 100% 1px no-repeat;
}

.tree-separator-ornament {
  position: relative;
  height: 7px;
  border: 0;
  background: linear-gradient(#a3afbe, #a3afbe) center / 100% 1px no-repeat;
}

.tree-separator-ornament::before,
.tree-separator-ornament::after {
  position: absolute;
  top: 2px;
  width: 3px;
  height: 3px;
  border: 1px solid #7e8ea3;
  background: #fff;
  content: '';
  transform: rotate(45deg);
}

.tree-separator-ornament::before {
  left: 1px;
}

.tree-separator-ornament::after {
  right: 1px;
}

.tree-separator-braid {
  height: 8px;
  border: 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 4px, #7f90a6 4px 5px, transparent 5px 9px),
    repeating-linear-gradient(45deg, transparent 0 4px, #bcc5d0 4px 5px, transparent 5px 9px);
}

.tree-separator-chain {
  height: 8px;
  border: 0;
  background:
    radial-gradient(ellipse at center, transparent 0 2px, #8191a6 2.2px 3px, transparent 3.2px) 0 50% / 11px 8px repeat-x,
    linear-gradient(#c7ced8, #c7ced8) center / 100% 1px no-repeat;
}

.tree-separator-feather {
  height: 8px;
  border: 0;
  background:
    repeating-linear-gradient(145deg, transparent 0 5px, #8b9bb0 5px 6px, transparent 6px 10px),
    linear-gradient(#b7c0cd, #b7c0cd) center / 100% 1px no-repeat;
}

.tree-separator-scallop {
  height: 9px;
  border: 0;
  background:
    radial-gradient(circle at 50% -1px, transparent 0 4px, #8495aa 4.2px 5px, transparent 5.2px) 0 0 / 12px 9px repeat-x,
    linear-gradient(#d1d7df, #d1d7df) 0 1px / 100% 1px no-repeat;
}

.tree-separator-crystal {
  height: 9px;
  border: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 6px, #73859d 6px 7px, transparent 7px 13px),
    repeating-linear-gradient(-45deg, transparent 0 6px, #aab5c4 6px 7px, transparent 7px 13px),
    linear-gradient(#d3d9e1, #d3d9e1) center / 100% 1px no-repeat;
}

.tree-separator-flourish,
.tree-separator-laurel,
.tree-separator-crown,
.tree-separator-lotus,
.tree-separator-sunburst,
.tree-separator-royal,
.tree-separator-diamond-chain,
.tree-separator-arrow-fletch,
.tree-separator-fan,
.tree-separator-clover,
.tree-separator-scrollwork,
.tree-separator-constellation,
.tree-separator-palace,
.tree-separator-wave,
.tree-separator-leaf-vine {
  position: relative;
  height: 13px;
  border: 0;
  color: #7b8ca3;
}

.tree-separator-flourish {
  background:
    radial-gradient(ellipse at 50% 0, transparent 0 4px, #8b9bb0 4.4px 5.2px, transparent 5.5px) 0 6px / 18px 7px repeat-x,
    linear-gradient(#b9c2ce, #b9c2ce) center / 100% 1px no-repeat;
}

.tree-separator-flourish::before {
  position: absolute;
  inset: 3px auto auto 50%;
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  background: #fff;
  content: '';
  transform: translateX(-50%) rotate(45deg);
}

.tree-separator-laurel {
  background:
    repeating-linear-gradient(32deg, transparent 0 7px, #8798ae 7px 9px, transparent 9px 15px),
    repeating-linear-gradient(-32deg, transparent 0 7px, #a7b3c2 7px 9px, transparent 9px 15px),
    linear-gradient(#c4ccd6, #c4ccd6) center / 100% 1px no-repeat;
}

.tree-separator-crown {
  background: linear-gradient(#8d9db1, #8d9db1) center / 100% 1px no-repeat;
}

.tree-separator-crown::before {
  position: absolute;
  top: 1px;
  left: 50%;
  width: 19px;
  height: 11px;
  border-bottom: 2px solid currentColor;
  background: currentColor;
  clip-path: polygon(0 18%, 25% 62%, 50% 0, 75% 62%, 100% 18%, 86% 85%, 14% 85%);
  content: '';
  transform: translateX(-50%);
}

.tree-separator-lotus {
  background: linear-gradient(#aab5c3, #aab5c3) center / 100% 1px no-repeat;
}

.tree-separator-lotus::before {
  position: absolute;
  top: 1px;
  left: 50%;
  width: 22px;
  height: 11px;
  background: conic-gradient(from 225deg at 50% 100%, transparent 0 12%, #7c8da4 13% 19%, transparent 20% 30%, #9aa8b9 31% 38%, transparent 39% 48%, #7c8da4 49% 56%, transparent 57% 100%);
  content: '';
  transform: translateX(-50%);
}

.tree-separator-sunburst {
  background: linear-gradient(90deg, transparent, #9ba9ba 15%, #9ba9ba 85%, transparent) center / 100% 1px no-repeat;
}

.tree-separator-sunburst::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: repeating-conic-gradient(#74869e 0 10deg, transparent 10deg 24deg);
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px #74869e;
  content: '';
  transform: translateX(-50%);
}

.tree-separator-royal {
  background:
    linear-gradient(#8798ae, #8798ae) 0 4px / 100% 1px no-repeat,
    linear-gradient(#c0c8d3, #c0c8d3) 0 9px / 100% 1px no-repeat;
}

.tree-separator-royal::before {
  position: absolute;
  top: 1px;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 2px double currentColor;
  border-radius: 50% 50% 45% 45%;
  background: #fff;
  box-shadow: 0 0 0 3px #fff;
  content: '';
  transform: translateX(-50%) rotate(45deg);
}

.tree-separator-diamond-chain {
  background:
    linear-gradient(45deg, transparent 42%, #788aa2 43% 57%, transparent 58%) 0 50% / 12px 12px repeat-x,
    linear-gradient(-45deg, transparent 42%, #9eacbd 43% 57%, transparent 58%) 0 50% / 12px 12px repeat-x,
    linear-gradient(#c5cdd7, #c5cdd7) center / 100% 1px no-repeat;
}

.tree-separator-arrow-fletch {
  background:
    repeating-linear-gradient(35deg, transparent 0 8px, #7f91a8 8px 9px, transparent 9px 14px),
    repeating-linear-gradient(-35deg, transparent 0 8px, #a7b3c2 8px 9px, transparent 9px 14px),
    linear-gradient(#8999ad, #8999ad) center / 100% 1px no-repeat;
}

.tree-separator-arrow-fletch::before,
.tree-separator-arrow-fletch::after {
  position: absolute;
  top: 4px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  content: '';
}

.tree-separator-arrow-fletch::before { left: 0; border-right: 6px solid currentColor; }
.tree-separator-arrow-fletch::after { right: 0; border-left: 6px solid currentColor; }

.tree-separator-fan {
  background:
    radial-gradient(ellipse at 50% 100%, transparent 0 4px, #8495aa 4.4px 5.2px, transparent 5.5px) 0 0 / 16px 11px repeat-x,
    linear-gradient(#c2cad5, #c2cad5) 0 11px / 100% 1px no-repeat;
}

.tree-separator-clover {
  background: linear-gradient(#a5b1c0, #a5b1c0) center / 100% 1px no-repeat;
}

.tree-separator-clover::before {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -4px 4px 0 currentColor, 4px 4px 0 currentColor, 0 8px 0 currentColor, 0 4px 0 #fff;
  content: '';
  transform: translateX(-50%);
}

.tree-separator-scrollwork {
  background:
    radial-gradient(circle at 100% 50%, transparent 0 4px, #7f91a7 4.3px 5px, transparent 5.3px) 0 50% / 20px 12px repeat-x,
    radial-gradient(circle at 0 50%, transparent 0 4px, #a3afbe 4.3px 5px, transparent 5.3px) 10px 50% / 20px 12px repeat-x,
    linear-gradient(#c8cfd8, #c8cfd8) center / 100% 1px no-repeat;
}

.tree-separator-constellation {
  background:
    radial-gradient(circle, #71849d 0 1.5px, transparent 1.7px) 0 2px / 25px 11px repeat-x,
    radial-gradient(circle, #a0adbd 0 1px, transparent 1.2px) 12px 8px / 25px 11px repeat-x,
    linear-gradient(100deg, transparent, #bac3cf 12%, #8999ad 50%, #bac3cf 88%, transparent) center / 100% 1px no-repeat;
}

.tree-separator-palace {
  background:
    repeating-linear-gradient(90deg, #7f91a8 0 2px, transparent 2px 9px, #a5b1c0 9px 10px, transparent 10px 18px),
    linear-gradient(#8496ac, #8496ac) 0 2px / 100% 1px no-repeat,
    linear-gradient(#b6c0cd, #b6c0cd) 0 10px / 100% 1px no-repeat;
}

.tree-separator-wave {
  background:
    radial-gradient(ellipse at 50% 100%, transparent 0 5px, #7e90a7 5.3px 6px, transparent 6.3px) 0 -1px / 20px 8px repeat-x,
    radial-gradient(ellipse at 50% 0, transparent 0 5px, #a2afbf 5.3px 6px, transparent 6.3px) 10px 7px / 20px 8px repeat-x;
}

.tree-separator-leaf-vine {
  background:
    radial-gradient(ellipse at 70% 20%, #7e90a7 0 2px, transparent 2.3px) 0 0 / 14px 9px repeat-x,
    radial-gradient(ellipse at 30% 80%, #9eacbd 0 2px, transparent 2.3px) 7px 4px / 14px 9px repeat-x,
    linear-gradient(#aeb9c6, #aeb9c6) center / 100% 1px no-repeat;
}

.tree-separator-label {
  max-width: 72%;
  overflow: hidden;
  color: #687386;
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-separator-secondary {
  display: none;
}

.separator-position-left-top,
.separator-position-center-top {
  grid-template-rows: minmax(14px, auto) 4px;
}

.separator-position-left-top .tree-separator-label,
.separator-position-center-top .tree-separator-label {
  grid-row: 1;
}

.separator-position-left-top .tree-separator-primary,
.separator-position-center-top .tree-separator-primary {
  grid-row: 2;
}

.separator-position-left-bottom,
.separator-position-center-bottom {
  grid-template-rows: 4px minmax(14px, auto);
}

.separator-position-left-bottom .tree-separator-primary,
.separator-position-center-bottom .tree-separator-primary {
  grid-row: 1;
}

.separator-position-left-bottom .tree-separator-label,
.separator-position-center-bottom .tree-separator-label {
  grid-row: 2;
}

.separator-position-left-top .tree-separator-label,
.separator-position-left-bottom .tree-separator-label {
  justify-self: start;
}

.separator-position-center-top .tree-separator-label,
.separator-position-center-bottom .tree-separator-label {
  justify-self: center;
  text-align: center;
}

.separator-position-center-line {
  grid-template-columns: minmax(12px, 1fr) minmax(0, auto) minmax(12px, 1fr);
  column-gap: 7px;
}

.separator-position-center-line .tree-separator-primary {
  grid-column: 1;
}

.separator-position-center-line .tree-separator-label {
  grid-column: 2;
  justify-self: center;
  max-width: 150px;
  text-align: center;
}

.separator-position-center-line .tree-separator-secondary {
  display: block;
  grid-column: 3;
}

.separator-position-center-line .tree-separator-short {
  width: 100%;
}

.separator-no-text {
  display: block;
}

.separator-no-text .tree-separator-label,
.separator-no-text .tree-separator-secondary {
  display: none;
}

.ft-separator-row {
  min-height: 30px;
  cursor: default;
}

.ft-separator-preview {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 24px;
  margin: 0 4px;
}

.ft-separator-row:hover .tree-separator {
  border-color: #8a95a8;
}

.ft-node-actions {
  display: none;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.ft-edit-row:hover .ft-node-actions {
  display: flex;
}

.ft-node-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}

.ft-node-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.ft-delete-btn:hover {
  background: var(--color-danger) !important;
  color: #fff !important;
}

.ft-hide-btn {
  color: #6b7280;
}

.ft-hide-btn:hover {
  background: rgba(107,114,128,0.1) !important;
  color: #374151 !important;
}

.ft-hidden-active {
  color: #dc2626 !important;
  background: rgba(220,38,38,0.08) !important;
  font-weight: 500;
}

.ft-hidden-active:hover {
  background: rgba(220,38,38,0.15) !important;
}

/* 拖拽手柄 */
.ft-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
}

.ft-edit-row:hover .ft-drag-handle {
  opacity: 1;
}

.ft-drag-handle:active {
  cursor: grabbing;
}

.ft-edit-row.ft-dragging {
  opacity: 0.4;
  background: #f0f9ff;
}

.ft-edit-row.ft-drag-ghost {
  outline: 2px dashed #0ea5e9;
  outline-offset: -2px;
}

.ft-edit-row.ft-drag-over-folder {
  background: #e0f2fe !important;
  outline: 2px solid #0ea5e9;
  outline-offset: -2px;
  border-radius: 4px;
}

.ft-drop-line {
  height: 2px;
  background: #0ea5e9;
  border-radius: 1px;
  margin: 1px 8px;
  pointer-events: none;
  position: relative;
  z-index: 100;
}

.ft-drop-line::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ea5e9;
}

/* 编辑模式下目录区顶部提示条 */
.sidebar-tree.edit-mode-active {
  border-top: 2px solid var(--color-primary);
}


/* ============================================================
   节点加号按钮（替换原来的隐藏/添加/改名/删除按钮）
   ============================================================ */
.ft-node-plus-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.ft-edit-row:hover .ft-node-plus-btn {
  display: inline-flex;
}

body.edit-mode #mineFolderList .ft-edit-row {
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding-top: 5px;
  padding-bottom: 5px;
  border-radius: var(--radius);
}

body.edit-mode #mineFolderList .ft-edit-row > * {
  margin-top: 0 !important;
}

body.edit-mode #mineFolderList .mine-tree-folder-name,
body.edit-mode #mineFolderList .mine-tree-file-name {
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  line-height: 1.4;
}

.mine-edit-drag-handle svg {
  width: 12px;
  height: 12px;
  opacity: 0.4;
}

.mine-edit-node-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mine-edit-node-icon svg {
  width: 15px;
  height: 15px;
}

.mine-edit-folder-icon {
  font-size: 14px;
  line-height: 1;
}

body.edit-mode #mineFolderList .ft-node-actions {
  margin-left: auto;
}

.ft-node-plus-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* ============================================================
   节点操作菜单（加号菜单弹出）
   ============================================================ */
.ft-node-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px;
  min-width: 130px;
  font-size: 13px;
}

.ft-separator-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.42);
}

.ft-separator-dialog {
  width: min(440px, 100%);
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.2);
}

.ft-separator-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f4;
  color: #1a3a5c;
  font-size: 14px;
  font-weight: 600;
}

.ft-separator-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8a95a8;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.ft-separator-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.ft-separator-style-field {
  padding: 1px 16px 14px;
}

.ft-separator-style-field .ft-separator-field-label {
  margin-top: 11px;
}

.ft-separator-style-dropdown {
  position: relative;
}

.ft-separator-style-toggle {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 7px 9px 7px 11px;
  border: 1px solid #d7dde5;
  border-radius: 5px;
  background: #fff;
  color: #253047;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ft-separator-style-toggle:hover,
.ft-separator-style-toggle:focus-visible,
.ft-separator-style-toggle.open {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
  outline: none;
}

.ft-separator-style-toggle > svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.ft-separator-style-toggle.open > svg {
  transform: rotate(180deg);
}

.ft-separator-style-name {
  font-size: 13px;
}

.ft-separator-style-menu {
  position: absolute;
  z-index: 4;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: min(360px, 48vh);
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #cbd3de;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.ft-separator-style-menu[hidden] {
  display: none;
}

.ft-separator-style-option {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.ft-separator-style-option:hover,
.ft-separator-style-option:focus-visible {
  background: #f3f6f9;
  outline: none;
}

.ft-separator-style-option.active {
  background: #e9f0f7;
  color: #1a3a5c;
  font-weight: 600;
}

.ft-separator-select {
  width: 100%;
  height: 36px;
  padding: 6px 30px 6px 10px;
  border: 1px solid #d7dde5;
  border-radius: 5px;
  background: #fff;
  color: #253047;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.ft-separator-select:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
}

.ft-separator-options {
  display: grid;
  gap: 4px;
  padding: 0 12px 10px;
}

.ft-separator-option {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ft-separator-option:hover,
.ft-separator-option:focus-visible,
.ft-separator-option.active {
  border-color: #d7dde5;
  background: #f7f8fa;
  outline: none;
}

.ft-separator-option.active {
  border-color: #1a3a5c;
  background: #f0f4f8;
}

.ft-separator-option-name {
  font-size: 13px;
}

.ft-separator-section-title,
.ft-separator-field-label {
  display: block;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}

.ft-separator-section-title {
  padding: 12px 16px 7px;
}

.ft-separator-config {
  padding: 2px 16px 14px;
  border-top: 1px solid #edf0f4;
}

.ft-separator-field-label {
  margin: 11px 0 6px;
}

.ft-separator-field-label span {
  color: #9aa3b2;
  font-weight: 400;
}

.ft-separator-text-input {
  width: 100%;
  height: 36px;
  padding: 7px 10px;
  border: 1px solid #d7dde5;
  border-radius: 5px;
  box-sizing: border-box;
  color: #253047;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.ft-separator-text-input:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
}

.ft-separator-text-style-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ft-separator-control-field {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}

.ft-separator-color-control {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 4px 8px 4px 5px;
  border: 1px solid #d7dde5;
  border-radius: 5px;
  box-sizing: border-box;
  background: #fff;
  color: #596273;
  font-size: 12px;
  font-weight: 400;
}

.ft-separator-color-control:focus-within {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
}

.ft-separator-color-control input[type="color"] {
  width: 30px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.ft-separator-position-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ft-separator-position-btn {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #d7dde5;
  border-radius: 5px;
  background: #fff;
  color: #596273;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.ft-separator-position-btn:hover,
.ft-separator-position-btn:focus-visible {
  background: #f7f8fa;
  outline: none;
}

.ft-separator-position-btn.active {
  border-color: #1a3a5c;
  background: #f0f4f8;
  color: #1a3a5c;
  font-weight: 600;
}

.ft-separator-preview-box {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid #edf0f4;
  border-radius: 5px;
  background: #fafbfc;
  box-sizing: border-box;
}

.ft-separator-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #edf0f4;
}

.ft-separator-cancel,
.ft-separator-confirm {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.ft-separator-cancel {
  border: 1px solid #d7dde5;
  background: #fff;
  color: #596273;
}

.ft-separator-confirm {
  border: 1px solid #1a3a5c;
  background: #1a3a5c;
  color: #fff;
}

@media (max-width: 480px) {
  .ft-separator-position-options,
  .ft-separator-text-style-fields {
    grid-template-columns: 1fr;
  }

  .ft-separator-style-toggle,
  .ft-separator-style-option {
    grid-template-columns: 72px minmax(0, 1fr) 16px;
  }

  .ft-separator-style-option {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

.ft-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: none;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s;
  white-space: nowrap;
}

.ft-menu-item:hover {
  background: #f3f4f6;
}

.ft-menu-submenu {
  position: relative;
}

.ft-menu-submenu-toggle .ft-menu-submenu-arrow {
  margin-left: auto;
  font-size: 17px;
  line-height: 1;
  color: #94a3b8;
}

.ft-menu-submenu-panel {
  position: absolute;
  top: -4px;
  left: calc(100% + 6px);
  display: none;
  min-width: 148px;
  padding: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.ft-menu-submenu:hover > .ft-menu-submenu-panel,
.ft-menu-submenu:focus-within > .ft-menu-submenu-panel,
.ft-menu-submenu.open > .ft-menu-submenu-panel {
  display: block;
}

.ft-menu-submenu-panel.align-left {
  right: calc(100% + 6px);
  left: auto;
}

.ft-menu-submenu-panel .ft-menu-item.active {
  background: #eef5ff;
  color: var(--color-primary, #1a3a5c);
  font-weight: 600;
}

.ft-menu-check {
  display: inline-flex;
  width: 13px;
  min-width: 13px;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #1a3a5c);
  font-size: 12px;
}

@media (max-width: 680px) {
  .ft-menu-submenu-panel,
  .ft-menu-submenu-panel.align-left {
    position: static;
    min-width: 0;
    margin: 2px 0 2px 22px;
    border-radius: 6px;
    box-shadow: none;
  }
}

.ft-menu-item-danger {
  color: #dc2626;
}

.ft-menu-item-danger:hover {
  background: rgba(220,38,38,0.08);
}

.ft-menu-item-settings {
  color: var(--color-primary, #1a3a5c);
  font-weight: 500;
}

.ft-menu-item-settings:hover {
  background: rgba(26,58,92,0.07);
}

.ft-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 6px;
}

/* ============================================================
   节点设置面板
   ============================================================ */
.ft-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ft-settings-dialog {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 360px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ft-settings-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.ft-settings-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c2333;
}

.ft-settings-node-name {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.ft-settings-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.ft-settings-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.ft-settings-body {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ft-settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ft-settings-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ft-settings-section-body {
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.ft-settings-icon-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
}

.ft-settings-icon-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ft-settings-btn-upload {
  background: #0ea5e9;
  color: #fff;
  display: inline-flex;
  align-items: center;
}

.ft-settings-btn-upload:hover {
  background: #0284c7;
  opacity: 1;
}

.ft-settings-btn {
  padding: 6px 14px;
  background: var(--color-primary, #1a3a5c);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.ft-settings-btn:hover {
  opacity: 0.85;
}

.ft-settings-btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.ft-settings-btn-secondary:hover {
  background: #d1d5db;
  opacity: 1;
}

.ft-settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ft-settings-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.ft-settings-radio input[type="radio"] {
  accent-color: var(--color-primary, #1a3a5c);
  width: 14px;
  height: 14px;
}

.ft-settings-points-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  margin-left: 0;
  color: #4b5563;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.ft-settings-points-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ft-settings-points-row input.ft-settings-hours-input {
  width: 64px;
}

.ft-settings-points-row[hidden] {
  display: none;
}

.ft-settings-points-row input {
  width: 90px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #1f2937;
  font: inherit;
  text-align: center;
  outline: none;
}

.ft-settings-points-row input:focus {
  border-color: var(--color-primary, #1a3a5c);
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
}

.ft-settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.ft-settings-toggle input[type="checkbox"] {
  display: none;
}

.ft-settings-toggle-track {
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ft-settings-toggle-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ft-settings-toggle input:checked + .ft-settings-toggle-track {
  background: var(--color-primary, #1a3a5c);
}

.ft-settings-toggle input:checked + .ft-settings-toggle-track::after {
  left: 18px;
}

.ft-settings-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   「我的文件」拖拽移动样式
   ============================================================ */
.mine-drag-source {
  opacity: 0.5;
}

.mine-drag-over {
  background: rgba(59, 130, 246, 0.1) !important;
  outline: 2px dashed #3b82f6;
  outline-offset: -2px;
  border-radius: 4px;
}

.mine-tree-folder-row[draggable="true"],
.mine-tree-file-row[draggable="true"] {
  cursor: grab;
}

.mine-tree-folder-row[draggable="true"]:active,
.mine-tree-file-row[draggable="true"]:active {
  cursor: grabbing;
}

/* ============================================================
   「我的下载」列表样式
   ============================================================ */
.mine-downloads-list {
  padding: 0;
}

.mine-download-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 16px;
  cursor: default;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background 0.15s;
  font-size: 12px;
}

.mine-download-row:hover {
  background: var(--color-surface-alt);
}

.mine-download-ext {
  flex-shrink: 0;
  width: 30px;
  height: 18px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

.mine-download-info {
  flex: 1;
  min-width: 0;
}

.mine-download-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
}

.mine-download-name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.mine-download-meta {
  font-size: 10px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}


/* 排序拖拽：插入线 */
.mine-sort-before {
  border-top: 2px solid #3b82f6 !important;
}
.mine-sort-after {
  border-bottom: 2px solid #3b82f6 !important;
}

/* 排序手柄 */
.mine-sort-handle {
  cursor: grab;
  color: #c0c8d4;
  font-size: 14px;
  padding: 0 3px 0 0;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.mine-tree-folder-row:hover .mine-sort-handle {
  opacity: 1;
}
.mine-sort-handle:active {
  cursor: grabbing;
}


/* 编辑模式：根目录拖拽目标区域 */
.ft-root-drop-zone {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 4px 4px 6px 4px;
  padding: 6px 8px;
  border: 1.5px dashed #c0c8d4;
  border-radius: 6px;
  color: #8a95a8;
  font-size: 11px;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.ft-root-drop-zone.ft-root-drop-active {
  background: rgba(59, 130, 246, 0.08);
  border-color: #3b82f6;
  color: #3b82f6;
}
.ft-root-drop-label {
  pointer-events: none;
}


/* Tab 栏拖动排序 */
.sidebar-tab[draggable="true"] {
  cursor: grab;
}
.sidebar-tab[draggable="true"]:active {
  cursor: grabbing;
}
.sidebar-tab.tab-dragging {
  opacity: 0.4;
}
.sidebar-tab.tab-drag-over-left {
  border-left: 2px solid var(--color-primary, #1a3a5c) !important;
  margin-left: -2px;
}
.sidebar-tab.tab-drag-over-right {
  border-right: 2px solid var(--color-primary, #1a3a5c) !important;
  margin-right: -2px;
}

/* 封面设置预览区 */
.ft-settings-cover-preview {
  margin-bottom: 8px;
  background: #f0f4f8;
  border-radius: 6px;
  padding: 8px;
  border: 1px solid #dde1e7;
}
.ft-settings-cover-preview img {
  border: 1px solid #dde1e7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 文件封面展示区 */
.archive-preview-wrapper { background:#f7f9fc !important; color:#22324a; }
.archive-viewer-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:16px 22px; border-bottom:1px solid #dce3ec; background:#fff; position:sticky; top:0; z-index:2; }
.archive-viewer-title { display:flex; align-items:baseline; gap:12px; min-width:0; }
.archive-viewer-title strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:17px; color:#153452; }
.archive-viewer-title span { color:#8794a7; font-size:13px; white-space:nowrap; }
.archive-viewer-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.archive-filter { width:238px; height:36px; padding:0 12px; border:1px solid #d6dde7; border-radius:5px; background:#fff; color:#26364c; font:inherit; outline:none; }
.archive-filter:focus { border-color:#6c8fb4; box-shadow:0 0 0 2px rgba(73,116,158,.12); }
.archive-viewer-actions button { height:36px; padding:0 13px; border:1px solid #d6dde7; border-radius:5px; background:#fff; color:#49627d; font:inherit; cursor:pointer; }
.archive-viewer-actions button:hover { border-color:#9fb1c6; background:#f2f6fa; }
.archive-tree { padding:12px 0 28px; }
.archive-tree-row { display:flex; align-items:center; gap:9px; width:100%; min-height:41px; padding:6px 22px 6px calc(20px + var(--archive-depth) * 25px); border:0; background:transparent; color:#293c54; font:inherit; font-size:14px; text-align:left; cursor:pointer; }
.archive-tree-row:hover { background:#eaf3fb; }
.archive-tree-row:disabled { color:#293c54; cursor:default; opacity:1; }
.archive-tree-row:disabled:hover { background:transparent; }
.archive-tree-toggle { width:12px; color:#71839a; font-size:12px; transform:rotate(0); transition:transform .12s ease; }
.archive-tree-row[aria-expanded="true"] .archive-tree-toggle { transform:rotate(90deg); }
.archive-entry-icon { width:16px; height:16px; flex:0 0 16px; display:inline-flex; align-items:center; justify-content:center; }
.archive-folder-icon { font-size:14px; line-height:1; }
.archive-file-icon { color:#6b7280; }
.archive-file-icon svg { width:15px; height:15px; display:block; }
.archive-tree-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.archive-tree-meta { margin-left:auto; padding-left:16px; color:#9aa6b6; font-size:12px; white-space:nowrap; }
.archive-viewer-loading, .archive-viewer-empty { padding:42px 24px; text-align:center; color:#718096; line-height:2; }
.archive-viewer-empty .file-download-btn { display:inline-flex; margin-top:12px; padding:8px 16px; background:#1a3a5c; color:#fff; border-radius:6px; text-decoration:none; }
@media (max-width: 760px) {
  .archive-viewer-toolbar { align-items:stretch; flex-direction:column; gap:10px; padding:13px 14px; }
  .archive-viewer-actions { display:grid; grid-template-columns:1fr auto auto; }
  .archive-filter { width:100%; min-width:0; }
  .archive-tree-row { padding-right:14px; padding-left:calc(14px + var(--archive-depth) * 20px); }
}

.docfile-cover-display {
  flex-shrink: 0;
}
.docfile-cover-display img {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 封面图片区域（面包屑上方） */
#pageCoverArea {
  width: 100%;
  overflow: hidden;
  background: #f0f4f8;
  text-align: center;
  padding: 0;
  flex-shrink: 0;
}
#pageCoverArea img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 目录树节点封面图片 */
.tree-node-cover {
  overflow: hidden;
  line-height: 0;
}
.tree-node-cover img {
  display: block;
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  margin-bottom: 2px;
  transition: opacity 0.2s;
}
.tree-node-cover img:hover {
  opacity: 0.9;
}

/* 收藏文件夹选择弹窗 */
.fav-folder-picker {
  position: fixed;
  z-index: 9999;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 200px;
  max-width: 260px;
  padding: 4px 0;
  display: none;
}

.fav-folder-picker-title {
  padding: 8px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 4px;
}

.fav-folder-option {
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
  margin: 0 4px;
  transition: background 0.15s;
}

.fav-folder-option:hover {
  background: var(--color-hover);
}


/* 文件预览底部富文本内容 */
.docfile-editor-container {
  width: 100%;
  flex: 0 0 auto;
  background: #fff;
  border-color: #dde1e7;
  box-sizing: border-box;
}
.docfile-editor-top {
  padding: 10px 16px 16px;
  border-bottom: 1px solid #dde1e7;
}
.docfile-editor-title {
  padding: 0 0 8px;
  color: #1c2333;
  font-size: 14px;
  font-weight: 600;
}
.docfile-editor-container > textarea {
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 8px;
  border: 1px solid #cfd6e0;
  box-sizing: border-box;
}
.docfile-editor-container .ke-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
.docfile-bottom-content-display {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 16px;
  background: #ffffff;
  border-top: 1px solid #dde1e7;
  color: #1c2333;
  font-size: 14px;
  line-height: 1.75;
}
.docfile-bottom-content-display img { max-width: 100%; height: auto; }
.docfile-bottom-content-display table { max-width: 100%; border-collapse: collapse; }
.docfile-bottom-content-display table td,
.docfile-bottom-content-display table th { border: 1px solid #d1d5db; padding: 6px 8px; }
#kindEditorBottomContainer { flex: 0 0 auto; background: #fff; margin-top: 12px; }

/* bottomContent 底部富文本编辑器可见性修复 */
#pageContent { min-height: 0; }
/* 文件预览wrapper铺满内容区（非编辑模式） */
#pageContent .docfile-preview-wrapper {
  flex: 1;
  min-height: 0;
}
#kindEditorBottomContainer {
  flex: 0 0 auto;
  display: block;
  position: relative;
  z-index: 5;
  background: #fff;
  margin-top: 10px;
  border-top: 1px solid #dde1e7;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
#kindEditorBottomContainer .ke-container {
  margin: 0 16px 16px;
}
.docfile-bottom-content-display,
.docfile-note-bottom-display {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 16px;
  background: #fff;
  border-top: 1px solid #dde1e7;
  color: #1c2333;
  font-size: 14px;
  line-height: 1.75;
}
.docfile-bottom-content-display img,
.docfile-note-bottom-display img { max-width: 100%; height: auto; }


/* 全屏模式右上角操作按钮组 */
.fullscreen-control-group {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fullscreen-exit-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #c5d5f0;
  background: #e8f0fe;
  color: #1a3a5c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.fullscreen-exit-button svg {
  width: 22px;
  height: 22px;
}
.fullscreen-exit-button:hover {
  background: #1a3a5c;
  color: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}
.fullscreen-exit-button:active {
  background: #1e4976;
}

.fullscreen-content-nav-btn {
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.fullscreen-control-group .content-nav-divider {
  height: 26px;
  margin: 0 1px;
  background: rgba(148, 163, 184, 0.75);
}


/* ============================================================
   文件预览全屏高度修复：F11/内容区全屏时去除底部大面积留白
   ============================================================ */
.content-area-fullscreen {
  overflow: hidden !important;
}
.content-area-fullscreen .content-area-inner {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}
.content-area-fullscreen .page-content {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
}
.content-area-fullscreen .docfile-preview-wrapper {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.content-area-fullscreen .docfile-preview-iframe {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: none !important;
}
.content-area-fullscreen .docfile-bottom-content-display {
  margin-top: 0 !important;
  flex-shrink: 0 !important;
}

/* ============================================================
   全屏模式文件预览与底部富文本滚动修复
   - 文件预览占满首屏
   - 底部富文本/底部编辑器不固定在底部，位于文件内容之后，向下滚动出现
   ============================================================ */
.content-area-fullscreen {
  overflow: hidden !important;
}
.content-area-fullscreen .content-area-inner {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}
.content-area-fullscreen .page-content {
  flex: 1 1 auto !important;
  height: 100vh !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 !important;
  scroll-behavior: smooth;
}
.content-area-fullscreen .docfile-preview-wrapper {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.content-area-fullscreen .docfile-preview-iframe {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: none !important;
}
.content-area-fullscreen .docfile-bottom-content-display,
.content-area-fullscreen .docfile-note-bottom-display,
.content-area-fullscreen #kindEditorBottomContainer {
  position: relative !important;
  margin-top: 12px !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
}


/* ============================================================
   V159 全屏文件展示修复
   - 全屏后“文件展示栏目/文件预览容器”铺满网站首屏
   - iframe 在标题栏下方填满剩余空间
   - 底部富文本不参与首屏高度分配，位于下一屏，继续下滑后出现
   ============================================================ */
.content-area-fullscreen,
.content-area-fullscreen .content-area-inner {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}
.content-area-fullscreen .page-content {
  display: block !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}
.content-area-fullscreen .docfile-preview-wrapper.docfile-preview-fullscreen {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.content-area-fullscreen .docfile-preview-wrapper.docfile-preview-fullscreen .docfile-preview-iframe {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  border: none !important;
  display: block !important;
}
.content-area-fullscreen .docfile-bottom-content-display,
.content-area-fullscreen .docfile-note-bottom-display,
.content-area-fullscreen #kindEditorBottomContainer {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  min-height: auto !important;
  margin-top: 0 !important;
  padding-top: 12px !important;
  box-sizing: border-box !important;
}


/* ============================================================
   V166 我的文件全屏展示修复
   - 修复 我的 → 我的文件 → 文件全屏 后底部大面积留白
   - 仅影响“我的文件”预览容器，不改变目录文件预览逻辑
   ============================================================ */
.content-area-fullscreen {
  overflow: hidden !important;
}
.content-area-fullscreen .content-area-inner {
  height: 100vh !important;
  max-height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
}
.content-area-fullscreen .page-content {
  height: 100vh !important;
  max-height: 100vh !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
/* 全屏时 mine-file-content-scroll 作为滚动容器，底部编辑器跟随内容流 */
.content-area-fullscreen .mine-file-content-scroll {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
}
/* 当 page-content 是 mine-file-content-scroll 时，允许 content-area-inner 正常显示滚动 */
.content-area-fullscreen:has(.mine-file-content-scroll) .content-area-inner {
  overflow: visible !important;
}
.content-area-fullscreen .mine-file-preview-wrapper {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}
.content-area-fullscreen .mine-file-preview-wrapper iframe,
.content-area-fullscreen .mine-file-preview-iframe,
.content-area-fullscreen .mine-file-preview-wrapper embed,
.content-area-fullscreen .mine-file-preview-wrapper object {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: none !important;
  display: block !important;
}
.content-area-fullscreen .mine-file-preview-wrapper > div {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  box-sizing: border-box !important;
}
.content-area-fullscreen .mine-file-preview-wrapper img,
.content-area-fullscreen .mine-file-preview-wrapper video {
  max-height: 100% !important;
}


/* “我的”右侧专属界面 */
.mine-exclusive-page {
  min-height: 100%;
  padding: 56px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.mine-exclusive-card {
  width: 100%;
  max-width: 880px;
  background: #ffffff;
  border: 1px solid var(--color-border-light);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 35, 56, 0.08);
  padding: 52px 56px;
  text-align: center;
}

.mine-exclusive-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mine-exclusive-icon svg { width: 38px; height: 38px; }

.mine-exclusive-card h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 32px;
  line-height: 1.3;
  color: var(--color-primary);
  margin-bottom: 8px;
  font-weight: 700;
}

.mine-exclusive-subtitle {
  font-size: 20px;
  color: var(--color-accent-dark);
  margin-bottom: 16px;
  font-weight: 600;
}

.mine-exclusive-desc {
  font-size: 15px;
  color: var(--color-text-secondary);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

.mine-exclusive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 8px;
}

.mine-exclusive-item {
  text-align: left;
  padding: 22px;
  border: 1px solid var(--color-border-light);
  border-radius: 14px;
  background: #f8fafc;
  transition: var(--transition);
}

.mine-exclusive-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  background: #ffffff;
}

.mine-exclusive-item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.mine-exclusive-item-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .mine-exclusive-page { padding: 32px 20px; }
  .mine-exclusive-card { padding: 36px 24px; }
  .mine-exclusive-grid { grid-template-columns: 1fr; }
}


/* V168：我的右侧专属界面铺满内容展示区，并去除居中卡片边框留白 */
.mine-exclusive-page {
  width: 100%;
  min-height: 100%;
  height: 100%;
  padding: 0 !important;
  display: flex;
  background: #ffffff;
}
.mine-exclusive-card {
  width: 100% !important;
  max-width: none !important;
  min-height: 100%;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 72px 72px !important;
  text-align: center;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mine-exclusive-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mine-exclusive-icon svg { width: 38px; height: 38px; }
.mine-exclusive-card h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 34px;
  line-height: 1.3;
  color: var(--color-primary);
  margin-bottom: 22px;
  font-weight: 700;
}
.mine-exclusive-subtitle { display: none !important; }
.mine-exclusive-desc {
  font-size: 15px;
  color: var(--color-text-secondary);
  max-width: 760px;
  margin: 0 auto 36px;
  line-height: 1.9;
}
.mine-exclusive-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 8px;
}
.mine-exclusive-item {
  text-align: left;
  padding: 26px;
  border: 1px solid var(--color-border-light);
  border-radius: 14px;
  background: #f8fafc;
  transition: var(--transition);
}
.mine-exclusive-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  background: #ffffff;
}
.mine-exclusive-item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.mine-exclusive-item-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
@media (max-width: 768px) {
  .mine-exclusive-card { padding: 36px 22px !important; }
  .mine-exclusive-grid { grid-template-columns: 1fr; }
}


/* V170 我的面板拖拽排序提示 */
.mine-tree-file-row[draggable="true"], .mine-download-row[draggable="true"] { cursor: move; }
.mine-drag-source { opacity: .45; }
.mine-sort-before { border-top: 2px solid #2f7df6 !important; }
.mine-sort-after { border-bottom: 2px solid #2f7df6 !important; }

/* V171 我的面板拖拽排序提示 */
.mine-drag-source{opacity:.45!important;}
.mine-sort-before{border-top:2px solid #3b82f6!important;}
.mine-sort-after{border-bottom:2px solid #3b82f6!important;}
.mine-tree-folder-row[draggable="true"],.mine-tree-file-row[draggable="true"],.mine-download-row[draggable="true"],.mine-fav-root-sort-wrap[draggable="true"]{cursor:move;}


/* V180：我的 -> 我的文件编辑模式：顶部/底部富文本编辑器 */
.mine-file-content-scroll { scroll-behavior: auto; }
.mine-file-editor-block {
  background: #f8fafc;
  border-color: #dde1e7;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  padding: 10px 12px;
}
.mine-file-editor-top { border-bottom: 1px solid #dde1e7; }
.mine-file-editor-bottom {
  border-top: 1px solid #dde1e7;
  position: relative !important;
  bottom: auto !important;
}
.mine-file-editor-title {
  font-size: 13px;
  font-weight: 600;
  color: #1c2333;
  margin-bottom: 6px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.mine-file-editor-tip { font-size:12px; color:#8a95a8; margin-bottom:6px; }
.mine-file-inline-save { border:1px solid #cfd6e0; background:#fff; border-radius:4px; padding:3px 8px; cursor:pointer; }
.mine-file-preview-wrapper {
  flex-shrink: 0;
  background: #fff;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.mine-file-preview-wrapper .mine-file-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
body.edit-mode .mine-file-preview-wrapper {
  min-height: 70vh !important;
  height: 70vh !important;
  flex: 0 0 auto !important;
}
body:not(.edit-mode) .mine-file-preview-wrapper {
  min-height: 100%;
  flex: 1 1 auto;
}
.mine-file-media-box { display:flex; align-items:center; justify-content:center; padding:24px; background:#fff; min-height:70vh; }
.mine-file-note-display,
.mine-file-note-display-bottom {
  flex-shrink: 0;
  position: relative;
  background:#fff;
  padding:16px 20px;
  border-color:#edf0f5;
}
.mine-file-note-display { border-bottom:1px solid #edf0f5; }
.mine-file-note-display-bottom { border-top:1px solid #edf0f5; }


/* ============================================================
   搜索板块专属界面样式
   ============================================================ */
.plaza-page {
  width: 100%;
  min-height: 100%;
  background: var(--color-surface);
  padding: 28px 36px 36px;
}

.plaza-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border-light);
}

.plaza-page-header h1 {
  margin: 0;
  color: var(--color-primary);
  font-size: 22px;
  line-height: 1.35;
}

.plaza-page-count {
  min-height: 18px;
  margin-top: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.plaza-page-refresh {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.plaza-list {
  width: 100%;
}

.plaza-list-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--color-border-light);
  background: transparent;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.plaza-content-folder-row {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 18px 30px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 12px;
  padding-top: 9px;
  padding-right: 32px;
  padding-bottom: 9px;
  border: 0;
  border-bottom: 1px solid var(--color-border-light);
  background: transparent;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.plaza-content-folder-row:hover { background: var(--color-surface-alt); }
.plaza-content-folder-row .plaza-tree-folder-icon { width: 24px; height: 24px; }
.plaza-content-folder > .plaza-tree-children { border-left: 1px solid var(--color-border-light); }

.plaza-list-row:hover {
  background: var(--color-surface-alt);
}

.plaza-list-rank {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.plaza-file-ext {
  width: 48px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
}

.plaza-file-type-icon {
  width: 48px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.plaza-file-type-icon svg,
.plaza-file-type-icon img {
  width: 22px;
  height: 22px;
}

.plaza-file-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.plaza-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
}

.plaza-file-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 11px;
}

.plaza-file-popularity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
}

.plaza-file-popularity svg,
.plaza-open-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.plaza-open-icon { color: var(--color-text-muted); }

.plaza-empty {
  padding: 72px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .plaza-page { padding: 20px 16px 28px; }
  .mine-tree-share-btn { opacity: 1; }
  .mine-tree-share-btn.active { opacity: 1; }
  .mine-folder-add-btn,
  .mine-file-action-btn { opacity: 1; }
  .plaza-list-row {
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    gap: 8px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .plaza-list-rank { display: none; }
  .plaza-file-ext { width: 34px; height: 30px; font-size: 8px; }
  .plaza-file-type-icon { width: 34px; height: 30px; }
  .plaza-file-popularity { font-size: 11px; }
  .plaza-content-folder-row {
    grid-template-columns: 14px 22px minmax(0, 1fr) 54px;
    gap: 7px;
    padding-right: 8px;
  }
  .plaza-content-folder-row .plaza-tree-folder-icon { width: 20px; height: 20px; }
}

.search-exclusive-page {
  min-height: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
}

.search-exclusive-card {
  width: 100%;
  max-width: 100%;
  background: var(--color-surface);
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 32px 40px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.search-exclusive-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-exclusive-icon svg {
  width: 20px;
  height: 20px;
}

.search-exclusive-title {
  font-size: 20px;
  line-height: 1.3;
  color: var(--color-primary);
  margin-bottom: 0;
  font-weight: 700;
  text-align: left;
}

.search-exclusive-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: left;
  margin: 0 0 20px;
  line-height: 1.7;
}

.search-exclusive-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid var(--color-border-light);
  border-radius: 10px;
  padding: 0 12px;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 20px;
}

.search-exclusive-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 30, 80, 140), 0.10);
  background: #fff;
}

.search-exclusive-input-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #8a95a8;
}

.search-exclusive-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--color-text-primary);
  padding: 12px 0;
  font-family: inherit;
}

.search-exclusive-input::placeholder {
  color: #b0b8c4;
}

.search-exclusive-clear {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #b0b8c4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.search-exclusive-clear:hover {
  color: #6b7280;
}

.search-exclusive-clear svg {
  width: 14px;
  height: 14px;
}

.search-exclusive-results {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
}

.search-exclusive-count {
  font-size: 12px;
  color: #8a95a8;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 8px;
}

.search-exclusive-loading,
.search-exclusive-empty {
  font-size: 13px;
  color: #8a95a8;
  padding: 20px 0;
  text-align: center;
}

.search-exclusive-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid var(--color-border-light);
}

.search-exclusive-result-item:last-child {
  border-bottom: none;
}

.search-exclusive-result-item:hover {
  background: #f0f5ff;
}

.search-exclusive-result-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.search-exclusive-result-info {
  flex: 1;
  min-width: 0;
}

.search-exclusive-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-exclusive-result-path,
.search-exclusive-result-snippet {
  font-size: 12px;
  color: #8a95a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.search-exclusive-tips {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--color-border-light);
}

.search-exclusive-tip-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8a95a8;
}

.search-exclusive-tip-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-primary-light);
}

@media (max-width: 768px) {
  .search-exclusive-page { padding: 28px 16px; }
  .search-exclusive-card { padding: 32px 20px 28px; }
  .search-exclusive-tips { gap: 12px; }
}

/* ===== 我的文件：拖拽上传区域样式 ===== */
.mine-drop-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 8px 20px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  border: 1.5px dashed var(--color-border-light, #d7dce3);
  border-radius: 6px;
  margin: 4px 8px;
  transition: all 0.2s;
  pointer-events: none;
  user-select: none;
}

.mine-drop-zone-active .mine-drop-hint,
.mine-accordion-bd.mine-drop-zone-active .mine-drop-hint {
  border-color: var(--color-primary, #1a3a5c);
  background: rgba(26, 58, 92, 0.05);
  color: var(--color-primary, #1a3a5c);
}

.mine-accordion-bd.mine-drop-zone-active {
  background: rgba(26, 58, 92, 0.03);
  border-radius: 6px;
}

.mine-tree-folder-row.mine-drop-zone-active {
  background: rgba(26, 58, 92, 0.08) !important;
  outline: 1.5px dashed var(--color-primary, #1a3a5c);
  outline-offset: -2px;
  border-radius: 4px;
}


/* V196: 鼠标样式修复 - 非编辑模式下文件列表不显示move/grab样式 */
/* 非编辑模式：目录树文件行显示pointer（可点击），不显示move */
body:not(.edit-mode) .tree-node-row {
  cursor: pointer;
}
/* 非编辑模式：我的文件列表行不显示move/grab */
body:not(.edit-mode) .mine-tree-folder-row[draggable="true"],
body:not(.edit-mode) .mine-tree-file-row[draggable="true"],
body:not(.edit-mode) .mine-download-row[draggable="true"],
body:not(.edit-mode) .mine-fav-root-sort-wrap[draggable="true"] {
  cursor: default;
}
/* 非编辑模式：ft-edit-row（目录编辑树）不应显示，但保险起见 */
body:not(.edit-mode) .ft-edit-row {
  cursor: pointer;
}
/* 编辑模式：文件列表行显示move样式（可拖拽） */
body.edit-mode .mine-tree-folder-row[draggable="true"],
body.edit-mode .mine-tree-file-row[draggable="true"],
body.edit-mode .mine-download-row[draggable="true"],
body.edit-mode .mine-fav-root-sort-wrap[draggable="true"] {
  cursor: move;
}
body.edit-mode .mine-tree-folder-row[draggable="true"]:active,
body.edit-mode .mine-tree-file-row[draggable="true"]:active,
body.edit-mode .mine-download-row[draggable="true"]:active {
  cursor: grabbing;
}


/* ============================================================
   V204 目录文件全屏/编辑模式滚动修复
   - 全屏模式下有docfile-preview-wrapper时，page-content可滚动
   - 预览区占满首屏(100vh)，底部编辑框跟随在下方
   ============================================================ */
.content-area-fullscreen:has(.docfile-preview-wrapper) .page-content {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: block !important;
  height: 100vh !important;
  max-height: 100vh !important;
}
.content-area-fullscreen:has(.docfile-preview-wrapper) .content-area-inner {
  overflow: hidden !important;
}
.content-area-fullscreen .docfile-preview-wrapper.docfile-preview-fullscreen {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}
.content-area-fullscreen:has(.docfile-preview-wrapper) #kindEditorBottomContainer,
.content-area-fullscreen:has(.docfile-preview-wrapper) .docfile-bottom-content-display,
.content-area-fullscreen:has(.docfile-preview-wrapper) .docfile-note-bottom-display {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  margin-top: 0 !important;
  flex-shrink: 0 !important;
}

/* 编辑模式下（非全屏）文件页面滚动修复 */
body.edit-mode #pageContent {
  overflow-y: auto !important;
  display: block !important;
}
body.edit-mode #pageContent .docfile-preview-wrapper {
  flex: none !important;
}

/* 首页编辑模式：编辑容器充满内容展示区 */
#hp-edit-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}
#hp-edit-container .ke-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}


/* V206 修复：文件预览竖向铺满，底部富文本编辑器跟随文档流（非固定定位） */
#pageContent {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: 100% !important;
  min-height: 0 !important;
}

#pageContent .docfile-preview-wrapper,
#pageContent .mine-file-preview-wrapper {
  width: 100% !important;
  height: auto !important;
  min-height: calc(100vh - 96px) !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
}

/* 不可在线解析的“我的/广场”文件与目录文件使用完全相同的卡片留白。 */
#pageContent .mine-file-preview-wrapper.unsupported-file-preview {
  display: flex !important;
  flex-direction: column !important;
  padding: 40px 48px !important;
  overflow: auto !important;
}

#pageContent .docfile-preview-iframe,
#pageContent .mine-file-preview-iframe,
#pageContent .docfile-preview-wrapper iframe,
#pageContent .mine-file-preview-wrapper iframe,
#pageContent .mine-file-preview-wrapper embed,
#pageContent .mine-file-preview-wrapper object {
  width: 100% !important;
  min-height: calc(100vh - 140px) !important;
  height: auto !important;
  border: none !important;
  display: block !important;
  background: #fff !important;
}

#kindEditorBottomContainer,
.mine-file-editor-bottom {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  margin: 12px 0 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border-top: 1px solid #dde1e7 !important;
  box-shadow: none !important;
  z-index: auto !important;
}

#kindEditorBottomContainer .ke-container,
.mine-file-editor-bottom .ke-container {
  width: 100% !important;
  max-width: 100% !important;
}

.content-area-fullscreen #pageContent {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.content-area-fullscreen #pageContent .docfile-preview-wrapper,
.content-area-fullscreen #pageContent .mine-file-preview-wrapper {
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  flex: 0 0 auto !important;
}

.content-area-fullscreen #kindEditorBottomContainer,
.content-area-fullscreen .mine-file-editor-bottom {
  position: static !important;
  bottom: auto !important;
}

/* 文件预览按内容展示区计算高度，避免 viewport 减法在底部留下空白。 */
body:not(.edit-mode) .content-area:not(.content-area-fullscreen) #pageContent .docfile-preview-wrapper,
body:not(.edit-mode) .content-area:not(.content-area-fullscreen) #pageContent .mine-file-preview-wrapper {
  height: 100% !important;
  min-height: 100% !important;
  flex: 0 0 100% !important;
}

body:not(.edit-mode) .content-area:not(.content-area-fullscreen) #pageContent .docfile-preview-iframe,
body:not(.edit-mode) .content-area:not(.content-area-fullscreen) #pageContent .mine-file-preview-iframe {
  flex: 1 1 0 !important;
  height: 100% !important;
  min-height: 0 !important;
}

body:not(.edit-mode) .content-area:not(.content-area-fullscreen) #pageContent .mine-file-preview-wrapper > .mine-file-media-box {
  flex: 1 1 auto;
  min-height: 0;
}

/* Mine Mathcad pages sit directly inside pageContent instead of a preview
   wrapper. Fill the actual content viewport instead of using a fixed offset. */
#pageContent.mine-file-content-scroll > .mathcad-embedded-frame {
  flex: 1 1 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
}

/* 压缩包目录使用自己的滚动区，避免通用文件预览样式隐藏滚动条。 */
#pageContent .archive-preview-wrapper {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#pageContent .archive-preview-wrapper .archive-viewer-toolbar {
  position: relative;
  top: auto;
  flex: 0 0 auto;
}

#pageContent .archive-preview-wrapper .archive-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

body:not(.edit-mode) .content-area:not(.content-area-fullscreen) #pageContent .archive-preview-wrapper {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
}

.content-area-fullscreen #pageContent .archive-preview-wrapper {
  height: 100vh !important;
  min-height: 0 !important;
  max-height: 100vh !important;
}

body.edit-mode #pageContent .archive-preview-wrapper {
  height: calc(100vh - 140px) !important;
  min-height: 420px !important;
}

/* Image files from both Mine and Plaza share this preview. Keep the image at
   its readable width and let this dedicated viewport expose the full height. */
#pageContent .mine-file-preview-wrapper.mine-file-image-preview {
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Fullscreen rules above use height:auto for generic file previews. Images
   need an explicit viewport so their percentage-height scroll box cannot
   collapse to zero. Mine and Plaza both use this same preview component. */
.content-area-fullscreen #pageContent .mine-file-preview-wrapper.mine-file-image-preview {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  flex: 0 0 100vh !important;
}

#pageContent .mine-file-image-box {
  flex: 1 1 0 !important;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  padding: 0;
  display: block;
  overflow: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

#pageContent .mine-file-image-box .mine-file-preview-image,
.content-area-fullscreen #pageContent .mine-file-image-box .mine-file-preview-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none !important;
  margin: 0 auto;
}


.tree-load-more {
  display: block;
  width: calc(100% - 20px);
  min-height: 34px;
  margin: 8px 10px 12px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #475569;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.tree-load-more:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #1e3a5f;
}

/* Mobile browser chrome changes the visual viewport while legacy 100vh stays
   tied to the larger layout viewport. Use dynamic sizing and a bottom inset. */
@media (max-width: 768px) {
  .main-layout:has(.content-area-fullscreen) .sidebar-expand-btn,
  .main-layout:has(.content-area-fullscreen) .sidebar-collapsed-indicator,
  .main-layout:has(.content-area-fullscreen) .mobile-sidebar-swipe-overlay,
  .main-layout:has(.content-area-fullscreen) .mobile-sidebar-dismiss-overlay {
    display: none !important;
    pointer-events: none !important;
  }

  html,
  body {
    min-height: 100%;
  }

  .main-layout {
    height: 100dvh;
    min-height: 100svh;
    padding-bottom: max(5px, env(safe-area-inset-bottom, 0px));
  }

  .content-area,
  .content-area-inner {
    min-height: 0;
  }

  #pageContent,
  .page-content {
    scroll-padding-bottom: max(24px, env(safe-area-inset-bottom, 0px) + 24px);
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px) + 24px) !important;
  }

  .content-area-fullscreen,
  .content-area-fullscreen .content-area-inner,
  .content-area-fullscreen .page-content,
  .content-area-fullscreen #pageContent {
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .content-area-fullscreen .docfile-preview-wrapper.docfile-preview-fullscreen,
  .content-area-fullscreen .mine-file-preview-wrapper.mine-file-image-preview {
    height: 100dvh !important;
    min-height: 100dvh !important;
    flex-basis: 100dvh !important;
  }
}
/* Flyfish File Viewer：追加到 main.css 文件末尾。 */
.file-viewer-preview-wrapper,
.docfile-file-viewer,
.file-viewer-host,
.file-viewer-mount {
  width: 100%;
  height: 100%;
  min-height: 320px;
}
 
.file-viewer-preview-wrapper,
.docfile-file-viewer,
.file-viewer-host {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f5f7fa;
}
 
.file-viewer-mount {
  position: relative;
}
 
.file-viewer-status,
.file-viewer-error {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #5a6478;
  background: #f8fafc;
  font-size: 13px;
}
 
.file-viewer-status-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-top-color: #1a3a5c;
  border-radius: 50%;
  animation: file-viewer-spin 0.8s linear infinite;
}
 
.file-viewer-error {
  flex-direction: column;
  text-align: center;
}
 
.file-viewer-error strong {
  color: #1c2333;
  font-size: 15px;
}
 
.file-viewer-error-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
 
.file-viewer-retry-btn {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  line-height: 18px;
  text-decoration: none;
  cursor: pointer;
}
 
.file-viewer-retry-btn {
  color: #fff;
  border-color: #1a3a5c;
  background: #1a3a5c;
}

.legacy-doc-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #e8ebef;
}

.legacy-doc-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 6px 14px;
  border-bottom: 1px solid #d7dee8;
  background: #fff;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgb(15 23 42 / 8%);
}

.legacy-doc-toolbar strong {
  min-width: 0;
  overflow: hidden;
  color: #263244;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-doc-page-group {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 6px;
  border: 1px solid #dde5ef;
  border-radius: 8px;
  background: #f8fafc;
  box-sizing: border-box;
}

.legacy-doc-page-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #334155;
  background: transparent;
  font: 18px/1 system-ui, sans-serif;
  cursor: pointer;
}

.legacy-doc-page-group button:hover:not(:disabled) {
  border-color: #b9c8d8;
  color: #1769d8;
  background: #edf5ff;
}

.legacy-doc-page-group button:disabled {
  color: #a8b3c0;
  cursor: not-allowed;
}

.legacy-doc-page-meter {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 72px;
  gap: 3px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}

.legacy-doc-page-meter strong {
  color: #1e293b;
  font-size: 14px;
}

.legacy-doc-toolbar .file-viewer-download-link {
  flex: 0 0 auto;
  margin-left: auto;
}

.legacy-doc-pages {
  width: min(900px, calc(100% - 32px));
  margin: 20px auto;
  padding: 64px clamp(28px, 7vw, 84px);
  box-sizing: border-box;
  overflow: visible;
  color: #20242b;
  background: #fff;
  box-shadow: 0 2px 10px rgb(15 23 42 / 14%);
}

.legacy-doc-preview > .legacy-doc-pages {
  flex: 0 0 auto;
}

.legacy-doc-section + .legacy-doc-section {
  margin-top: 24px;
}

.legacy-doc-section h2 {
  margin: 0 0 10px;
  color: #4b5563;
  font-size: 14px;
  letter-spacing: 0;
}

.legacy-doc-text {
  font: 16px/1.85 "Microsoft YaHei", "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
  tab-size: 4;
  white-space: pre-wrap;
}

.legacy-doc-header,
.legacy-doc-footer {
  color: #667085;
  font-size: 13px;
}

.legacy-doc-supplement {
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 640px) {
  .legacy-doc-toolbar {
    gap: 8px;
    padding: 5px 6px;
    overflow-x: auto;
  }

  .legacy-doc-page-group {
    height: 32px;
    gap: 4px;
    padding: 0 4px;
  }

  .legacy-doc-page-group button {
    width: 26px;
    height: 26px;
  }

  .legacy-doc-page-meter {
    min-width: 52px;
  }

  .legacy-doc-pages {
    width: calc(100% - 16px);
    margin: 8px auto;
    padding: 32px 20px;
  }
}
 
@keyframes file-viewer-spin {
  to { transform: rotate(360deg); }
}

/* Deep dark mode for document surfaces. File Viewer renderers use an isolated
   root, so these rules intentionally target both the host and renderer shells. */
:root[data-color-mode="dark"] .file-viewer-preview-wrapper,
:root[data-color-mode="dark"] .docfile-file-viewer,
:root[data-color-mode="dark"] .file-viewer-host,
:root[data-color-mode="dark"] .file-viewer-mount,
:root[data-color-mode="dark"] .legacy-doc-preview,
:root[data-color-mode="dark"] .html-preview-stage {
  background: #11161c !important;
  color: #d8e0ea !important;
}

:root[data-color-mode="dark"] .file-viewer-status,
:root[data-color-mode="dark"] .file-viewer-error,
:root[data-color-mode="dark"] .legacy-doc-toolbar {
  background: #1b2027 !important;
  color: #d8e0ea !important;
  border-color: #3b4552 !important;
}

:root[data-color-mode="dark"] .file-viewer-error strong,
:root[data-color-mode="dark"] .legacy-doc-toolbar strong,
:root[data-color-mode="dark"] .legacy-doc-section h2 {
  color: #f4f7fb !important;
}

:root[data-color-mode="dark"] .legacy-doc-pages {
  background: #1b2027 !important;
  color: #d8e0ea !important;
  box-shadow: 0 2px 14px rgb(0 0 0 / 40%);
}

:root[data-color-mode="dark"] .legacy-doc-header,
:root[data-color-mode="dark"] .legacy-doc-footer,
:root[data-color-mode="dark"] .legacy-doc-page-meter {
  color: #aeb9c7 !important;
}

:root[data-color-mode="dark"] .legacy-doc-supplement {
  border-top-color: #3b4552 !important;
}

:root[data-color-mode="dark"] .file-viewer-host :is(canvas, svg, .pdf-page, .spreadsheet-grid, .spreadsheet-surface) {
  border-color: #3b4552 !important;
}

:root[data-color-mode="dark"] .file-viewer-host iframe {
  background: #171b21 !important;
}

:root[data-color-mode="dark"] #pageContent > .mathcad-embedded-frame {
  background: #11161c !important;
  color-scheme: dark;
}

:root[data-color-mode="dark"] .file-viewer-host [style*="background: white"],
:root[data-color-mode="dark"] .file-viewer-host [style*="background-color: white"] {
  background: #1b2027 !important;
}

/* Menus and popovers are often portaled directly under body, so they need
   explicit dark styles instead of relying on their parent surface. */
:root[data-color-mode="dark"] :is(
  .node-action-menu,
  .node-project-pick-modal,
  .directory-action-menu,
  .directory-share-menu,
  .mine-add-menu,
  .mine-folder-add-menu,
  .ft-node-menu,
  .ft-separator-style-menu,
  .ft-separator-dialog,
  .plaza-sort-menu,
  .brand-menu,
  .brand-appearance-submenu,
  .brand-language-submenu,
  .mobile-directory-menu,
  .mobile-directory-submenu
) {
  background: #1b2027 !important;
  color: #e7edf5 !important;
  border-color: #465361 !important;
  box-shadow: 0 10px 28px rgb(0 0 0 / 48%);
}

:root[data-color-mode="dark"] :is(
  .node-action-item,
  .directory-action-item,
  .directory-share-item,
  .mine-add-menu-item,
  .ft-menu-item,
  .ft-separator-style-option,
  .plaza-sort-menu-item,
  .mobile-directory-menu button,
  .mobile-directory-submenu .node-action-item
) {
  background: transparent !important;
  color: #d8e0ea !important;
}

:root[data-color-mode="dark"] :is(
  .node-action-item:hover,
  .directory-action-item:hover:not(:disabled),
  .directory-share-item:hover,
  .mine-add-menu-item:hover,
  .ft-menu-item:hover,
  .ft-separator-style-option:hover,
  .plaza-sort-menu-item:hover,
  .mobile-directory-menu button:hover
) {
  background: #2b3440 !important;
  color: #8fc5ff !important;
}

:root[data-color-mode="dark"] :is(
  .node-action-item:disabled,
  .directory-action-item:disabled,
  .ft-menu-item:disabled,
  .directory-menu-item.locked
) {
  color: #8290a0 !important;
  opacity: 1 !important;
}

:root[data-color-mode="dark"] :is(
  .node-action-menu-title,
  .directory-menu-heading,
  .ft-menu-divider,
  .ft-separator-dialog-header
) {
  color: #aeb9c7 !important;
  border-color: #3b4552 !important;
}

:root[data-color-mode="dark"] :is(
  .ft-separator-style-toggle,
  .archive-filter,
  .archive-viewer-actions button
) {
  background: #202832 !important;
  color: #edf1f5 !important;
  border-color: #526274 !important;
}

/* All non-runtime preview types use the same dark surface language. */
:root[data-color-mode="dark"] :is(
  #pageContent .file-preview-theme-surface,
  #pageContent .docfile-preview-wrapper,
  #pageContent .mine-file-preview-wrapper,
  #pageContent .archive-preview-wrapper,
  #pageContent .unsupported-file-preview,
  #pageContent .mine-file-image-preview,
  #pageContent .content-frame-wrapper,
  #pageContent .vendor-help-frame-wrapper
) {
  background: #11161c !important;
  color: #d8e0ea !important;
  border-color: #3b4552 !important;
}

:root[data-color-mode="dark"] :is(
  .archive-viewer-toolbar,
  .archive-viewer-actions button,
  .mine-file-image-box,
  .unsupported-file-preview,
  .archive-viewer-empty,
  .archive-viewer-loading
) {
  background: #1b2027 !important;
  color: #d8e0ea !important;
  border-color: #3b4552 !important;
}

:root[data-color-mode="dark"] :is(.archive-viewer-title strong, .archive-tree-row) {
  color: #edf1f5 !important;
}

:root[data-color-mode="dark"] .archive-tree-row:hover,
:root[data-color-mode="dark"] .archive-viewer-actions button:hover {
  background: #2b3440 !important;
}

:root[data-color-mode="dark"] .mine-file-preview-image {
  background: #1b2027 !important;
}

:root[data-color-mode="dark"] #pageContent :is(
  .docfile-preview-wrapper,
  .mine-file-preview-wrapper,
  .docfile-file-viewer,
  .unsupported-file-preview,
  .content-frame-wrapper,
  .vendor-help-frame-wrapper,
  #kindEditorBottomContainer,
  .mine-file-editor-bottom
) {
  background: #11161c !important;
  color: #d8e0ea !important;
  border-color: #3b4552 !important;
}

:root[data-color-mode="dark"] #pageContent :is(
  .file-preview-media-box,
  .searchable-text-file-preview,
  .text-file-preview-loading,
  .docfile-bottom-content-display,
  .docfile-note-bottom-display,
  .mine-file-note-display,
  .mine-file-note-display-bottom,
  .mine-file-media-box,
  .mine-exclusive-card
) {
  background: #1b2027 !important;
  color: #d8e0ea !important;
  border-color: #3b4552 !important;
}

:root[data-color-mode="dark"] #pageContent .searchable-text-file-preview {
  color: #d8e0ea !important;
}


:root[data-color-mode="dark"] #pageContent :is(
  .docfile-preview-wrapper iframe,
  .mine-file-preview-wrapper iframe,
  .docfile-preview-iframe,
  .mine-file-preview-iframe
) {
  background: #11161c !important;
}

:root[data-color-mode="dark"] :is(.ke-container, .ke-toolbar, .ke-statusbar, .ke-edit,
  .ke-edit-iframe, .ke-dialog, .ke-dialog-content, .ke-dialog-body) {
  background: #1b2027 !important;
  color: #d8e0ea !important;
  border-color: #3b4552 !important;
}
:root[data-color-mode="dark"] .ke-edit-iframe {
  filter: none !important;
}
 /* 编辑模式会把外层改为 height:auto。
   Viewer 必须重新获得确定高度，否则 PDF/XLSX 挂载后是空白。 */
body.edit-mode #pageContent .file-viewer-preview-wrapper,
body.edit-mode #pageContent .file-viewer-preview-wrapper .docfile-file-viewer,
body.edit-mode #pageContent .file-viewer-preview-wrapper .file-viewer-host,
body.edit-mode #pageContent .file-viewer-preview-wrapper .file-viewer-mount {
  width: 100% !important;
  height: calc(100vh - 140px) !important;
  min-height: 520px !important;
  flex: 0 0 auto !important;
}

@media (max-width: 768px) {
  body.edit-mode #pageContent .file-viewer-preview-wrapper,
  body.edit-mode #pageContent .file-viewer-preview-wrapper .docfile-file-viewer,
  body.edit-mode #pageContent .file-viewer-preview-wrapper .file-viewer-host,
  body.edit-mode #pageContent .file-viewer-preview-wrapper .file-viewer-mount {
    height: 520px !important;
    min-height: 320px !important;
  }
}
/* 编辑模式进入全屏后，取消编辑模式固定高度。 */
body.edit-mode .content-area-fullscreen #pageContent .file-viewer-preview-wrapper,
body.edit-mode .content-area-fullscreen #pageContent .file-viewer-preview-wrapper .docfile-file-viewer,
body.edit-mode .content-area-fullscreen #pageContent .file-viewer-preview-wrapper .file-viewer-host,
body.edit-mode .content-area-fullscreen #pageContent .file-viewer-preview-wrapper .file-viewer-mount {
  height: 100% !important;
  min-height: 0 !important;
}

/* 普通全屏模式下，wrapper、host、mount 必须同时铺满。 */
.content-area-fullscreen .file-viewer-preview-wrapper,
.content-area-fullscreen .docfile-file-viewer,
.content-area-fullscreen .file-viewer-host,
.content-area-fullscreen .file-viewer-mount {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

.content-area-fullscreen .file-viewer-preview-wrapper .file-viewer-mount {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
}

@media (max-width: 768px) {
  .file-viewer-preview-wrapper,
  .docfile-file-viewer,
  .file-viewer-host,
  .file-viewer-mount {
    min-height: 320px;
  }

  .content-area-fullscreen .file-viewer-preview-wrapper,
  .content-area-fullscreen .docfile-file-viewer,
  .content-area-fullscreen .file-viewer-host,
  .content-area-fullscreen .file-viewer-mount {
    min-height: 0 !important;
  }
}

/* Mine previews stay in the page flow so top/bottom notes can scroll normally. */
#pageContent.mine-file-content-scroll {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#pageContent.mine-file-content-scroll > .mine-file-preview-wrapper,
#pageContent.mine-file-content-scroll > .mathcad-embedded-frame {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
}

#pageContent.mine-file-content-scroll > .mine-file-preview-wrapper,
#pageContent.mine-file-content-scroll > .file-viewer-preview-wrapper {
  width: 100% !important;
}

#pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper {
  flex: 0 0 auto !important;
  height: calc(100vh - 96px) !important;
  min-height: 320px !important;
  overflow: hidden !important;
}

#pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper .docfile-file-viewer,
#pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper .file-viewer-host,
#pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper .file-viewer-mount {
  flex: 1 1 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.edit-mode #pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper {
  height: calc(100vh - 140px) !important;
  min-height: 520px !important;
  flex: 0 0 auto !important;
}

.content-area-fullscreen #pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper {
  height: 100vh !important;
  min-height: 100vh !important;
  flex-basis: 100vh !important;
}

@media (max-width: 768px) {
  #pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper,
  body.edit-mode #pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper {
    height: 520px !important;
    min-height: 320px !important;
  }

  .content-area-fullscreen #pageContent.mine-file-content-scroll > .mine-file-preview-wrapper.file-viewer-preview-wrapper {
    height: 100dvh !important;
    min-height: 100dvh !important;
    flex-basis: 100dvh !important;
  }
}

/* The owned Mathcad editor is the only child after openMathcadPage clears the
   file notes. Restore the flex height chain that the generic edit-mode file
   rule changes to block, so the iframe fills all space below the breadcrumb. */
body.edit-mode #pageContent.mine-file-content-scroll:has(> .mathcad-embedded-frame) {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.edit-mode #pageContent.mine-file-content-scroll > .mathcad-embedded-frame {
  display: block !important;
  flex: 1 1 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
}
/* 全屏关键：wrapper、host、mount 三层都要铺满。 */
.content-area-fullscreen .file-viewer-preview-wrapper,
.content-area-fullscreen .docfile-file-viewer,
.content-area-fullscreen .file-viewer-host,
.content-area-fullscreen .file-viewer-mount {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}
 
.content-area-fullscreen .file-viewer-preview-wrapper .file-viewer-mount {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
}
 
@media (max-width: 768px) {
  .file-viewer-preview-wrapper,
  .docfile-file-viewer,
  .file-viewer-host,
  .file-viewer-mount {
    min-height: 320px;
  }
 
  .content-area-fullscreen .file-viewer-preview-wrapper,
  .content-area-fullscreen .docfile-file-viewer,
  .content-area-fullscreen .file-viewer-host,
  .content-area-fullscreen .file-viewer-mount {
    min-height: 0 !important;
  }
}
