/* Ve365 全局滚动条 — 毛玻璃细窄现代风格 */

:root {
  --scrollbar-size: 8px;
  --scrollbar-size-hover: 10px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(100, 116, 139, 0.35);
  --scrollbar-thumb-hover: rgba(71, 85, 105, 0.55);
  --scrollbar-thumb-active: rgba(51, 65, 85, 0.72);
  --scrollbar-glow: rgba(59, 130, 246, 0.15);
  --scrollbar-corner: transparent;
  --scrollbar-radius: 999px;
}

/* ===== 全局链接 — 无下划线 ===== */
a,
a:hover,
a:focus,
a:active,
a:visited {
  text-decoration: none;
}

/* ===== Firefox ===== */
*,
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ===== WebKit / Blink ===== */
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: var(--scrollbar-radius);
  margin: 4px;
}

*::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.45) 0%,
      rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg,
      var(--scrollbar-thumb),
      var(--scrollbar-thumb));
  border-radius: var(--scrollbar-radius);
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 6px var(--scrollbar-glow);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-width 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg,
      var(--scrollbar-thumb-hover),
      var(--scrollbar-thumb-active));
  background-clip: padding-box;
  box-shadow: 0 0 10px var(--scrollbar-glow);
  border-width: 1px;
}

*::-webkit-scrollbar-thumb:active {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0) 40%),
    var(--scrollbar-thumb-active);
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-corner);
}

/* 悬停容器时略微显现轨道（仅 WebKit） */
*:hover::-webkit-scrollbar {
  width: var(--scrollbar-size-hover);
  height: var(--scrollbar-size-hover);
}

/* ===== 首页 — 浅蓝毛玻璃 ===== */
.home-page {
  --scrollbar-thumb: rgba(59, 130, 246, 0.32);
  --scrollbar-thumb-hover: rgba(37, 99, 235, 0.52);
  --scrollbar-thumb-active: rgba(29, 78, 216, 0.68);
  --scrollbar-glow: rgba(59, 130, 246, 0.22);
}

/* ===== Office 通用浅色滚动区 ===== */
.theme-word .word-workspace,
.theme-word .nav-pane,
.theme-excel .grid-container,
.theme-excel .sheet-tabs,
.theme-excel .excel-modal,
.theme-word .word-modal,
.theme-word .symbol-grid,
.theme-ppt .ppt-canvas-wrap,
.theme-ppt .ppt-props,
.theme-ppt .sorter-overlay,
.office-app .file-panel-items,
.light-scroll {
  --scrollbar-thumb: rgba(100, 116, 139, 0.3);
  --scrollbar-thumb-hover: rgba(100, 116, 139, 0.5);
  --scrollbar-thumb-active: rgba(71, 85, 105, 0.65);
}

/* Word 蓝色调 */
.theme-word .word-workspace,
.theme-word .nav-pane {
  --scrollbar-thumb: rgba(24, 90, 189, 0.28);
  --scrollbar-thumb-hover: rgba(24, 90, 189, 0.48);
  --scrollbar-thumb-active: rgba(16, 69, 129, 0.62);
  --scrollbar-glow: rgba(24, 90, 189, 0.18);
}

/* Excel 绿色调 */
.theme-excel .grid-container,
.theme-excel .sheet-tabs,
.theme-excel .excel-modal {
  --scrollbar-thumb: rgba(33, 115, 70, 0.28);
  --scrollbar-thumb-hover: rgba(33, 115, 70, 0.48);
  --scrollbar-thumb-active: rgba(24, 92, 56, 0.62);
  --scrollbar-glow: rgba(33, 115, 70, 0.18);
}

/* PPT 浅区 */
.theme-ppt .ppt-canvas-wrap,
.theme-ppt .ppt-props,
.theme-ppt .sorter-overlay {
  --scrollbar-thumb: rgba(183, 71, 42, 0.26);
  --scrollbar-thumb-hover: rgba(183, 71, 42, 0.44);
  --scrollbar-thumb-active: rgba(147, 56, 38, 0.58);
  --scrollbar-glow: rgba(183, 71, 42, 0.16);
}

/* ===== Office 深色滚动区（侧栏等） ===== */
.theme-ppt .ppt-sidebar-list,
.dark-scroll {
  --scrollbar-thumb: rgba(255, 255, 255, 0.22);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.38);
  --scrollbar-thumb-active: rgba(255, 255, 255, 0.52);
  --scrollbar-glow: rgba(255, 255, 255, 0.08);
}

.theme-ppt .ppt-sidebar-list {
  --scrollbar-thumb: rgba(255, 255, 255, 0.2);
  --scrollbar-thumb-hover: rgba(255, 185, 160, 0.45);
  --scrollbar-thumb-active: rgba(255, 185, 160, 0.6);
  --scrollbar-glow: rgba(183, 71, 42, 0.2);
}

/* ===== 滚动容器平滑滚动 ===== */
.word-workspace,
.nav-pane,
.grid-container,
.ppt-sidebar-list,
.ppt-canvas-wrap,
.ppt-props,
.sorter-overlay,
.sheet-tabs,
.file-panel-items,
.excel-modal,
.word-modal,
.symbol-grid,
.home-wrap,
.light-scroll,
.dark-scroll {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* ===== 移动端：更细 ===== */
@media (max-width: 768px) {
  :root {
    --scrollbar-size: 5px;
    --scrollbar-size-hover: 6px;
  }

  *::-webkit-scrollbar-thumb {
    border-width: 1px;
  }
}

/* ===== 打印时隐藏 ===== */
@media print {
  *::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }
}
