:root,
html,
html.y,
html.z,
html.a,
html.b,
html.c,
html.d {
  color-scheme: dark;
  --od-bg: #121212;
  --od-panel: #292929;
  --od-panel-hover: #333333;
  --od-panel-press: #3a3a3a;
  --od-selected: #1f4b77;
  --od-selected-hover: #255784;
  --od-text: #f3f2f1;
  --od-muted: #adadad;
  --od-faint: #858585;
  --od-line: #3b3a39;
  --od-blue: #3157c8;
  --od-blue-hover: #3b63d8;
  --od-focus: #75b6ff;
  --font-main: "Segoe UI Web (West European)", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --fg: var(--od-text);
  --fg-max: #ffffff;
  --fg-weak: var(--od-muted);
  --bg: var(--od-panel);
  --bgg: var(--od-bg);
  --bg-max: var(--od-panel);
  --bg-u1: #303030;
  --bg-u2: #333333;
  --bg-u3: #373737;
  --bg-u4: #3b3b3b;
  --bg-d1: #232323;
  --bg-d2: #1f1f1f;
  --a: #8ab4f8;
  --a-b: #a9c7fa;
  --a-hil: #c6dcff;
  --btn-fg: var(--od-text);
  --btn-bg: #333333;
  --btn-h-fg: #ffffff;
  --btn-h-bg: #414141;
  --btn-1-fg: #ffffff;
  --btn-1-bg: var(--od-blue);
  --btn-1h-bg: var(--od-blue-hover);
  --tree-bg: var(--od-bg);
  --scroll: #666666;
  --g-sel-fg: #ffffff;
  --g-sel-bg: var(--od-selected);
  --g-sel-b1: #5688b8;
  background: var(--od-bg) !important;
  text-shadow: none !important;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  color: var(--od-text);
  background: var(--od-bg) !important;
  font-family: var(--font-main) !important;
  font-size: 14px;
}

.od-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor;
  pointer-events: none;
}

#od-shell { position: fixed; inset: 0; z-index: 350; pointer-events: none; }
#od-shell button,
#od-shell input,
#od-create-menu { pointer-events: auto; }

#od-topbar {
  position: fixed;
  z-index: 430;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 68px;
  color: var(--od-muted);
  background: var(--od-bg);
}

#od-brand {
  display: flex;
  align-items: center;
  width: 280px;
  min-width: 280px;
  height: 100%;
  padding: 0 16px 0 24px;
}
#od-logo { width: 36px; height: 36px; margin-right: 10px; }
#od-product-name { color: var(--od-text); font-size: 14px; font-weight: 600; white-space: nowrap; }
#od-file-mode {
  display: inline-flex;
  align-items: center;
  height: 36px;
  margin-left: 14px;
  padding: 0 16px;
  color: #fff;
  background: #292929;
  border: 1px solid #494949;
  border-radius: 18px;
  font-weight: 600;
}

#od-top-spacer { flex: 1; }
#od-top-actions { display: flex; align-items: center; gap: 10px; padding-right: 18px; }
.od-top-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--od-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.od-top-button:hover { color: #fff; background: #2a2a2a; }
#od-anon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--od-text);
  border: 1px solid #5f5f5f;
  border-radius: 50%;
  font-size: 13px;
}

#od-sidebar {
  position: fixed;
  z-index: 420;
  top: 68px;
  bottom: 0;
  left: 0;
  display: flex;
  width: 280px;
  padding: 18px 16px 18px;
  flex-direction: column;
  color: var(--od-muted);
  background: var(--od-bg);
}
#od-create {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 10px;
  color: #fff;
  background: var(--od-blue);
  border: 0;
  border-radius: 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#od-create:hover,
#od-create[aria-expanded="true"] { background: var(--od-blue-hover); }
#od-create .od-icon { width: 18px; height: 18px; }

#od-sidebar-title {
  margin: 26px 8px 9px;
  color: var(--od-text);
  font-weight: 600;
}
#od-side-nav { display: flex; flex-direction: column; gap: 2px; }
.od-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  color: var(--od-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.od-nav-item:hover { color: #fff; background: #242424; }
.od-nav-item.active { color: #fff; background: #090909; }
.od-nav-item.active::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -10px;
  width: 3px;
  background: #5c9ded;
  border-radius: 2px;
}
.od-nav-item.active .od-icon { color: #77a9f5; }

#od-storage { margin-top: auto; padding: 0 0 4px; }
#od-storage-title { margin-bottom: 9px; color: var(--od-text); font-weight: 600; }
#od-storage-track { height: 2px; margin-bottom: 9px; overflow: hidden; background: #6f6f6f; }
#od-storage-used { display: block; width: 0; height: 100%; background: #6fa9e8; }
#od-storage-copy { color: var(--od-muted); font-size: 12px; line-height: 1.4; }

#od-main-title {
  position: fixed;
  z-index: 390;
  top: 96px;
  left: 296px;
  color: var(--od-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
  pointer-events: none;
}
#od-toolbar {
  position: fixed;
  z-index: 400;
  top: 82px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 52px;
  color: var(--od-muted);
}
.od-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  color: var(--od-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
}
.od-tool:hover { color: #fff; background: #292929; }
#od-selected-tools { display: none; align-items: center; gap: 2px; }
#od-select { display: inline-flex !important; }
#od-selected-tools { display: none !important; }
body.od-has-selection #od-default-tools { display: none; }
body.od-has-selection #od-selected-tools { display: flex !important; }
#od-selection-count {
  height: 34px;
  padding: 7px 14px;
  border: 1px solid #4c4c4c;
  border-radius: 18px;
  color: var(--od-text);
}

#od-create-menu {
  position: fixed;
  z-index: 760;
  top: 134px;
  left: 16px;
  display: none;
  width: 248px;
  padding: 5px 0;
  color: var(--od-text);
  background: #292929;
  border: 1px solid #343434;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.42);
}
#od-create-menu.open { display: block; }
.od-create-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--od-text);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.od-create-item:hover { background: #383838; }
.od-create-separator { height: 1px; margin: 3px 0; background: #444; }

#opa_x {
  position: fixed;
  z-index: 850;
  top: 82px;
  right: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: #333;
  border: 1px solid #505050;
  border-radius: 50%;
  cursor: pointer;
}
body.od-native-open #opa_x { display: flex !important; }
body.od-native-open #od-toolbar { display: none; }
.od-native-folder-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  margin: 0 10px 8px 0;
  vertical-align: middle;
  background: url('/onedrive-assets/folder.svg') center / contain no-repeat;
}

/* Keep Copyparty's behavior, but place it inside the measured OneDrive frame. */
#tree,
#path,
#acc_info,
#srv_info,
#widget,
#repl,
#wrap > h2,
#opa_srch,
.ayjump { display: none !important; }

#ops {
  position: fixed !important;
  z-index: 840 !important;
  inset: 0 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  pointer-events: none;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#ops > a:not(#opa_x) { display: none !important; }
#ops > #opa_x { pointer-events: auto; }

#wrap {
  position: fixed !important;
  z-index: 20;
  top: 154px;
  right: 40px;
  bottom: 24px;
  left: 296px;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: auto;
  color: var(--od-muted);
  background: var(--od-panel);
  border: 0 !important;
  border-radius: 8px;
  box-shadow: none !important;
}

#files {
  position: relative !important;
  top: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
#files thead { position: sticky; z-index: 4; top: 0; }
#files thead tr,
#files tbody tr {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 190px 120px;
}
#files thead th {
  display: flex;
  align-items: center;
  height: 50px !important;
  padding: 0 12px !important;
  color: var(--od-muted) !important;
  background: var(--od-panel) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--od-line) !important;
  box-shadow: none !important;
  font-size: 0 !important;
  font-weight: 400 !important;
  text-align: left !important;
  text-transform: none !important;
}
#files thead th:nth-child(1), #files tbody td:nth-child(1) { order: 1; }
#files thead th:nth-child(2), #files tbody td:nth-child(2) { order: 2; }
#files thead th:nth-child(5), #files tbody td:nth-child(5) { order: 3; }
#files thead th:nth-child(3), #files tbody td:nth-child(3) { order: 4; }
#files thead th:nth-child(4),
#files tbody td:nth-child(4) { display: none !important; }
#files thead th:nth-child(1)::after { content: ""; }
#files thead th:nth-child(2)::after { content: "名称"; }
#files thead th:nth-child(5)::after { content: "修改时间"; }
#files thead th:nth-child(3)::after { content: "文件大小"; }
#files thead th::after { color: var(--od-muted); font-size: 14px; }
#files thead a,
#files thead span { color: inherit !important; background: transparent !important; font-size: 0 !important; }

#files tbody tr { position: relative; height: 50px; outline: none; }
.od-row-select {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #8a8886;
  border-radius: 50%;
  opacity: 0;
  background: #292929;
  cursor: pointer;
}
#files tbody tr:hover .od-row-select,
body.od-selection-mode .od-row-select,
#files tbody tr.sel .od-row-select { opacity: 1; }
#files tbody tr.sel .od-row-select {
  border-color: #69afe5;
  background: #0f6cbd;
}
#files tbody tr.sel .od-row-select::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
#files tbody td,
#files tr:nth-child(2n) td,
#files tr:nth-child(2n+1) td + td {
  display: flex;
  align-items: center;
  height: 50px !important;
  padding: 0 12px !important;
  color: var(--od-muted) !important;
  background: var(--od-panel) !important;
  border: 0 !important;
  border-bottom: 1px solid #323232 !important;
  box-shadow: none !important;
  font-family: var(--font-main) !important;
  font-size: 14px !important;
  vertical-align: middle;
}
#files tbody tr:hover td,
#files tbody tr:hover td + td { background: var(--od-panel-hover) !important; }
#files tbody tr.sel td,
#files tbody tr.sel td + td { color: #fff !important; background: var(--od-selected) !important; }
#files tbody tr.sel:hover td,
#files tbody tr.sel:hover td + td { background: var(--od-selected-hover) !important; }
#files tbody td:first-child { width: 96px; padding-left: 64px !important; }
#files tbody td:first-child::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 20px;
  width: 20px;
  height: 20px;
  border: 1px solid #8b8b8b;
  border-radius: 50%;
  opacity: 0;
}
body.od-selection-mode #files tbody td:first-child::before,
#files tbody tr.sel td:first-child::before { opacity: 1; }
#files tbody tr.sel td:first-child::before {
  background: #fff;
  border-color: #fff;
  box-shadow: inset 0 0 0 5px var(--od-selected);
}
#files tbody td:first-child a {
  display: block !important;
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  overflow: hidden;
  color: transparent !important;
  background: var(--od-file-icon, url('/onedrive-assets/txt.svg')) center / 28px 28px no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-size: 0 !important;
  box-shadow: none !important;
}
#files tbody tr.od-dir { --od-file-icon: url('/onedrive-assets/folder.svg'); }
#files tbody tr.od-pdf { --od-file-icon: url('/onedrive-assets/pdf.svg'); }
#files tbody tr.od-doc,
#files tbody tr.od-docx { --od-file-icon: url('/onedrive-assets/docx.svg'); }
#files tbody tr.od-xls,
#files tbody tr.od-xlsx { --od-file-icon: url('/onedrive-assets/xlsx.svg'); }
#files tbody tr.od-ppt,
#files tbody tr.od-pptx { --od-file-icon: url('/onedrive-assets/pptx.svg'); }
#files tbody tr.od-txt,
#files tbody tr.od-log { --od-file-icon: url('/onedrive-assets/txt.svg'); }
#files tbody tr.od-md,
#files tbody tr.od-js,
#files tbody tr.od-css,
#files tbody tr.od-html,
#files tbody tr.od-json { --od-file-icon: url('/onedrive-assets/code.svg'); }
#files tbody td:nth-child(2) a {
  display: block;
  overflow: hidden;
  color: var(--od-text) !important;
  background: transparent !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#files tbody td:nth-child(2) a:hover { color: #fff !important; text-decoration: underline; }
#files tbody td:nth-child(5),
#files tbody td:nth-child(3) { font-variant-numeric: tabular-nums; text-align: left !important; }

#lazy { margin: 0 !important; }
#epi {
  position: absolute !important;
  inset: 50px 0 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  margin: 0 !important;
  padding: 0 24px !important;
  color: var(--od-muted) !important;
  background: transparent !important;
  border: 0 !important;
  font-size: 16px !important;
  text-align: center;
}
#epi { display: none !important; }

.opview.act,
.opbox.act {
  position: fixed !important;
  z-index: 800 !important;
  top: 82px !important;
  right: 28px !important;
  bottom: 24px !important;
  left: 296px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 26px !important;
  overflow: auto !important;
  color: var(--od-text) !important;
  background: #242424 !important;
  border: 1px solid #414141 !important;
  border-radius: 8px !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.42) !important;
}
.opview h2,
.opview h3,
.opbox h2,
.opbox h3 { color: var(--od-text) !important; }
.opview a,
.opbox a { color: #9ec4ff; }
.btn,
input[type="submit"],
#u2btn {
  min-height: 36px;
  color: #fff !important;
  background: var(--od-blue) !important;
  border: 0 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  font-family: var(--font-main) !important;
  font-weight: 600;
}
input[type="text"],
input:not([type]),
textarea,
select {
  color: var(--od-text) !important;
  background: #333 !important;
  border: 1px solid #5d5d5d !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  font-family: var(--font-main) !important;
}

#rcm {
  z-index: 900 !important;
  min-width: 220px;
  padding: 5px !important;
  color: var(--od-text) !important;
  background: #292929 !important;
  border: 1px solid #414141 !important;
  border-radius: 6px !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.48) !important;
}
#rcm > a {
  min-height: 34px;
  padding: 8px 11px !important;
  color: var(--od-text) !important;
  background: transparent !important;
  border-radius: 4px !important;
}
#rcm > a:hover { background: #3a3a3a !important; }
#rcm .hide { display: none !important; }
#toast { z-index: 950 !important; border-radius: 6px !important; box-shadow: 0 14px 40px rgba(0,0,0,.5) !important; }

*:focus-visible { outline: 2px solid var(--od-focus) !important; outline-offset: 2px; }

@media (max-width: 820px) {
  #od-brand { width: 68px; min-width: 68px; padding: 0 16px; }
  #od-logo { width: 36px; height: 36px; margin: 0; }
  #od-product-name,
  #od-file-mode { display: none; }
  #od-top-actions { gap: 2px; padding-right: 16px; }
  #od-sidebar { width: 68px; padding: 18px 16px; }
  #od-create { width: 36px; padding: 0; justify-content: center; }
  #od-create-label,
  #od-sidebar-title,
  .od-nav-label,
  #od-storage-title,
  #od-storage-copy { display: none; }
  #od-side-nav { margin-top: 22px; gap: 8px; }
  .od-nav-item { width: 36px; padding: 0; justify-content: center; }
  .od-nav-item.active::before { left: -16px; }
  #od-storage-track { width: 36px; margin-bottom: 10px; }
  #od-main-title { top: 92px; left: 80px; }
  #od-toolbar { top: 126px; right: 48px; left: 80px; justify-content: flex-start; height: 44px; }
  .od-tool { padding: 0 8px; }
  #od-select { margin-left: auto; }
  #od-create-menu { top: 134px; }
  #wrap { top: 178px; right: 52px; bottom: 20px; left: 80px; border-radius: 7px; }
  #files thead { display: none; }
  #files tbody tr { display: grid; grid-template-columns: 54px minmax(0, 1fr); grid-template-rows: 27px 21px; min-height: 58px; height: 58px; }
  #files tbody td,
  #files tr:nth-child(2n) td,
  #files tr:nth-child(2n+1) td + td {
    display: block;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  #files tbody tr:hover,
  #files tbody tr.sel { border-radius: 4px; }
  #files tbody tr:hover { background: var(--od-panel-hover) !important; }
  #files tbody tr.sel { background: var(--od-selected) !important; }
  #files tbody tr:hover td,
  #files tbody tr:hover td + td,
  #files tbody tr.sel td,
  #files tbody tr.sel td + td { background: transparent !important; }
  #files tbody td:first-child { grid-row: 1 / 3; grid-column: 1; display: flex; align-items: center; justify-content: center; padding: 0 !important; }
  #files tbody td:first-child::before { top: 19px; left: 8px; width: 18px; height: 18px; }
  .od-row-select { top: 20px; left: 8px; }
  #files tbody td:first-child a { width: 28px !important; height: 28px !important; margin-left: 8px !important; background-size: 26px 26px !important; }
  #files tbody td:nth-child(2) { grid-row: 1; grid-column: 2; min-width: 0; padding: 9px 10px 0 0 !important; }
  #files tbody td:nth-child(2) a { font-size: 14px !important; }
  #files tbody td:nth-child(5) { grid-row: 2; grid-column: 2; overflow: hidden; padding: 0 80px 7px 0 !important; color: var(--od-muted) !important; font-size: 12px !important; text-align: left !important; text-overflow: ellipsis; white-space: nowrap; }
  #files tbody td:nth-child(3) { position: absolute; right: 10px; bottom: 7px; color: var(--od-muted) !important; font-size: 12px !important; }
  #files tbody td:nth-child(4) { display: none !important; }
  #epi { inset: 0 !important; font-size: 14px !important; }
  .opview.act,
  .opbox.act { top: 78px !important; right: 12px !important; bottom: 12px !important; left: 80px !important; padding: 18px !important; }
  #opa_x { top: 82px; right: 16px; }
}

@media (max-width: 350px) {
  #od-toolbar .od-icon { width: 18px; height: 18px; }
  #od-toolbar .od-tool-label { display: none; }
  #od-selection-count { padding-right: 10px; padding-left: 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
