:root {
  --primary: #673ab7;
  --primary-dark: #512da8;
  --accent: #ff4081;
  --teal: #00a99d;
  --text: #333;
  --muted: #777;
  --line: #e4e4e4;
  --drawer: 240px;
  font-family: Roboto, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: #fff;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* Login surface mirrors the original gradient and translucent form panel. */
.login-view {
  width: 100%; height: 100%; min-width: 0;
  display: grid; place-items: center;
  background: linear-gradient(179deg, #0e7aff 0%, #2182f9 8%, #264edd 59%, #6f14b8 100%);
}
.login-card {
  width: min(360px, calc(100vw - 40px));
  padding: 20px;
  border-radius: 4px;
  background: rgba(255,255,255,.20);
  box-shadow: 0 0 8px #eee;
  color: #fff;
}
.brand { display: flex; justify-content: center; align-items: center; gap: 6px; margin-bottom: 20px; }
.brand img { object-fit: contain; border-radius: 4px; }
.brand span { color: #67ffe3; letter-spacing: 1px; font-size: 24px; line-height: 1.2; font-weight: 700; white-space: nowrap; }
.field { position: relative; display: block; margin: 0 0 24px; color: rgba(255,255,255,.72); }
.field.floating { padding-left: 30px; }
.field-icon { position: absolute; left: 0; top: 9px; width: 22px; color: #183f85; font-size: 18px; text-align: center; }
.field-label { display: block; color: rgba(255,255,255,.62); font-size: 14px; line-height: 22px; }
.field input { width: 100%; height: 32px; padding: 2px 0; border: 0; border-bottom: 2px solid rgba(255,255,255,.86); outline: 0; color: #fff; background: transparent; }
.field input:focus { border-bottom-color: #ff4081; }
.field input::placeholder { color: rgba(255,255,255,.45); }
.field-error { display: block; min-height: 16px; color: #ff3e7b; font-size: 12px; line-height: 16px; }
.field:not(.invalid) .field-error { visibility: hidden; }
.field.invalid input { border-bottom-color: #ff4081; }
.field.invalid .field-error { color: #ff4081; }
.register-row { display: flex; justify-content: center; margin: -8px 0 18px; font-size: 14px; }
.register-row a { color: #234aa7; text-decoration: underline; }
.login-actions { display: flex; align-items: center; justify-content: space-between; padding-left: 10px; }
.check { display: inline-flex; align-items: center; gap: 7px; color: #67ffe3; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check span { width: 18px; height: 18px; border: 2px solid #274b86; display: inline-block; position: relative; }
.check input:checked + span::after { content: ""; position: absolute; width: 9px; height: 5px; left: 2px; top: 2px; border-left: 2px solid #67ffe3; border-bottom: 2px solid #67ffe3; transform: rotate(-45deg); }
.check input:focus-visible + span { outline: 3px solid rgba(255,64,129,.75); outline-offset: 2px; }
.btn { min-height: 36px; padding: 0 16px; border-radius: 3px; color: #555; background: rgba(255,255,255,.92); box-shadow: 0 2px 4px rgba(0,0,0,.18); transition: background .18s, box-shadow .18s, transform .18s; }
.btn:hover { box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.btn:active { transform: translateY(1px); }
.btn.primary { color: #67ffe3; background: rgba(93,64,161,.62); }
.btn.small { min-height: 30px; padding: 0 11px; font-size: 13px; }
.btn-icon { margin-right: 4px; }
.demo-link { display: block; width: 100%; margin-top: 18px; color: #fff; background: transparent; text-decoration: underline; opacity: .9; }
.login-note { margin: 10px 0 0; text-align: center; font-size: 11px; color: rgba(255,255,255,.72); }
.connection-settings { margin-top: 15px; border-top: 1px solid rgba(255,255,255,.25); padding-top: 10px; color: rgba(255,255,255,.84); font-size: 12px; }
.connection-settings summary { color: #67ffe3; cursor: pointer; text-align: center; }
.connection-settings .field.compact { margin: 10px 0 8px; color: rgba(255,255,255,.82); }
.connection-settings .field.compact input { color: #fff; border-color: rgba(255,255,255,.7); background: rgba(0,0,0,.08); }
.connection-settings .field.compact input::placeholder { color: rgba(255,255,255,.5); }
.connection-settings .btn { display: block; margin-left: auto; }

/* Main file manager. */
.app-view { width: 100%; height: 100%; background: #fff; }
.appbar { position: fixed; z-index: 20; inset: 0 0 auto 0; height: 64px; display: flex; align-items: center; padding: 0 12px; color: #fff; background: var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,.30); }
.appbar h1 { min-width: 0; margin: 0 0 0 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; line-height: 1; font-weight: 500; }
.toolbar-spacer { flex: 1; }
.icon-btn { width: 44px; height: 44px; margin: 0 1px; border-radius: 50%; color: #fff; background: transparent; font-size: 25px; line-height: 44px; text-align: center; }
.icon-btn:hover { background: rgba(255,255,255,.15); }
.menu { position: absolute; z-index: 50; min-width: 190px; padding: 8px 0; border-radius: 3px; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.26); color: #333; }
.toolbar-menu { top: 55px; right: 7px; }
.menu button { width: 100%; height: 42px; padding: 0 16px; display: flex; align-items: center; gap: 13px; text-align: left; background: transparent; color: #333; }
.menu button:hover { background: #f3f3f3; }
.menu button span { width: 20px; color: var(--primary); font-size: 19px; text-align: center; }
.drawer { position: fixed; z-index: 18; top: 64px; bottom: 0; left: 0; width: var(--drawer); overflow: auto; background: #fff; border-right: 1px solid #e1e1e1; box-shadow: 1px 0 3px rgba(0,0,0,.08); }
.drawer nav { padding: 7px 0 24px; }
.drawer .subheader { height: 33px; padding: 9px 16px 5px; color: #777; font-size: 14px; }
.drawer a, .drawer nav button { width: 100%; min-height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 24px; color: #333; background: transparent; text-decoration: none; font-size: 16px; text-align: left; }
.drawer a:hover, .drawer nav button:hover { background: #f2f2f2; }
.nav-icon { width: 24px; color: #777; font-size: 22px; text-align: center; }
.drawer-foot { padding: 14px 16px; border-top: 1px solid #eee; color: #9b9b9b; font-size: 11px; }
.content { position: fixed; top: 64px; right: 0; bottom: 0; left: var(--drawer); display: flex; flex-direction: column; min-width: 0; background: #fff; }
.file-list { flex: 1; overflow: auto; padding: 4px 0 0; }
.empty { height: 100%; display: grid; place-items: center; color: #999; font-size: 14px; }
.subheader { height: 36px; display: flex; align-items: center; padding: 0 26px; color: #777; font-size: 14px; border-bottom: 1px solid #f2f2f2; }
.file-row { min-height: 64px; display: flex; align-items: center; padding: 0 17px 0 18px; border-bottom: 1px solid #f1f1f1; transition: background .16s; }
.file-row:hover { background: #fafafa; }
.file-row.selected { background: rgba(63,81,181,.18); }
.avatar { width: 42px; height: 42px; margin-right: 12px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 5px; color: #65717d; background: #f2f4f7; font-size: 23px; cursor: pointer; }
.avatar img { width: 42px; height: 42px; object-fit: cover; border-radius: 5px; }
.file-row.selected .avatar { background: #fff; color: #3f51b5; }
.file-main { min-width: 0; flex: 1; cursor: pointer; }
.file-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; font-size: 16px; line-height: 25px; word-break: break-all; }
.file-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6f6f6f; font-size: 12px; line-height: 18px; }
.row-menu-wrap { position: relative; }
.row-more { width: 38px; height: 38px; border-radius: 50%; color: #777; background: transparent; font-size: 23px; }
.row-more:hover { background: #eee; }
.row-menu { right: 0; top: 36px; min-width: 150px; }
.row-menu button { height: 38px; font-size: 13px; }
.pager { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 3px 8px 6px; border-top: 1px solid #f1f1f1; }
.pager select { height: 34px; padding: 0 21px 0 8px; border: 0; border-bottom: 1px solid #ddd; outline: 0; color: #333; background: #fff; }
.page-count { min-width: 92px; height: 34px; color: #e40035; background: transparent; font-size: 13px; }
.page-icon { width: 34px; height: 34px; border-radius: 50%; color: #777; background: transparent; font-size: 19px; }
.page-icon:hover:not(:disabled) { background: #eee; }
.page-icon:disabled { color: #c8c8c8; cursor: default; }
.fab-wrap { position: fixed; z-index: 25; right: 24px; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fab { display: grid; place-items: center; border-radius: 50%; color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.28); transition: transform .2s, box-shadow .2s; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 5px 11px rgba(0,0,0,.30); }
.fab-main { width: 56px; height: 56px; background: var(--accent); font-size: 28px; }
.fab-small { width: 42px; height: 42px; font-size: 19px; }
.fab-dial { display: flex; flex-direction: column; gap: 10px; }
.orange { background: #ff9800; }.pink { background: #e91e63; }.blue { background: #2196f3; }.brown { background: #795548; }.teal { background: #009688; }

/* Dialogs and transient messages. */
.dialog { width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 4px; background: transparent; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-card { max-height: calc(100vh - 28px); display: flex; flex-direction: column; margin: 0; background: #fff; color: #333; }
.dialog-title { padding: 20px 24px 13px; color: #333; font-size: 20px; font-weight: 500; }
.dialog-content { overflow: auto; padding: 0 24px 18px; line-height: 1.6; font-size: 14px; }
.dialog-content p { margin: 7px 0 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px 12px; border-top: 1px solid #eee; }
.muted { color: #777; }
code { padding: 1px 4px; border-radius: 2px; color: #c2185b; background: #f9f0f4; font-family: Consolas, monospace; font-size: .92em; word-break: break-all; }
.field.compact { margin: 10px 0 14px; color: #555; }
.field.compact > span { display: block; margin-bottom: 4px; font-size: 13px; }
.field.compact input, .field.compact select { width: 100%; height: 36px; padding: 0 8px; border: 1px solid #c8c8c8; border-radius: 2px; color: #333; outline: 0; background: #fff; }
.field.compact input:focus, .field.compact select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(103,58,183,.13); }
.link-result { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid #e0e0e0; border-radius: 3px; background: #fafafa; }
.link-result code { min-width: 0; flex: 1; color: #333; background: transparent; }
details { margin-top: 17px; border-top: 1px solid #eee; padding-top: 10px; }
summary { cursor: pointer; color: var(--primary); }
pre { overflow: auto; padding: 10px; border-radius: 3px; color: #e8eaf6; background: #25232b; font: 12px/1.45 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.panel { border-bottom: 1px solid #eee; }
.panel-head { min-height: 50px; display: flex; align-items: center; gap: 10px; color: #555; }
.panel-head span { margin-left: auto; color: #999; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 13px 26px; }
.chip { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px 0 6px; border-radius: 16px; color: #555; background: #f0f0f0; font-size: 12px; }
.chip:hover { background: #e0e0e0; }
.chip:first-letter { color: var(--primary); font-weight: 700; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 22px; max-width: min(520px, calc(100vw - 32px)); padding: 11px 17px; border-radius: 3px; color: #fff; background: #323232; box-shadow: 0 3px 10px rgba(0,0,0,.28); transform: translate(-50%, 90px); opacity: 0; pointer-events: none; transition: transform .22s, opacity .22s; font-size: 13px; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

:focus-visible { outline: 3px solid rgba(255,64,129,.75); outline-offset: 2px; }

@supports (height: 100dvh) {
  .login-view, .app-view { height: 100dvh; }
}

@media (max-height: 560px) {
  body { overflow: auto; }
  .login-view { min-height: 560px; }
}

@media (max-width: 700px) {
  :root { --drawer: 240px; }
  .brand span { font-size: 20px; }
  .drawer { transform: translateX(-100%); transition: transform .2s; box-shadow: 3px 0 10px rgba(0,0,0,.25); }
  .drawer.open { transform: translateX(0); }
  .drawer-shade { position: fixed; z-index: 17; inset: 64px 0 0; display: block; background: rgba(0,0,0,.35); }
  .content { left: 0; }
  .file-row { padding-left: 9px; padding-right: 8px; }
  .subheader { padding-left: 16px; }
  .fab-wrap { right: 15px; bottom: 16px; }
}

@media (min-width: 701px) {
  .app-view.drawer-closed .drawer { transform: translateX(-100%); }
  .app-view.drawer-closed .content { left: 0; }
}

@media (max-width: 420px) {
  .login-card { width: calc(100vw - 24px); min-width: 0; padding: 17px; }
  .brand span { font-size: 17px; letter-spacing: 0; }
  .appbar h1 { margin-left: 10px; font-size: 18px; }
  .appbar .icon-btn { width: 37px; }
  .appbar .icon-btn[data-toolbar="parent"] { display: none; }
  .file-title { font-size: 15px; }
  .pager { gap: 1px; }
  #firstPage, #lastPage { display: none; }
}
