:root {
  color-scheme: light;
  --ink: #16213a;
  --dim: #52617a;
  --muted: #63738c;
  --line: #e4eaf3;
  --canvas: #f6f8fc;
  --white: #fff;
  --blue: #244fda;
  --blue-ink: #2445af;
  --blue-soft: #eaf0ff;
  --danger: #aa203a;
  --good: #17634e;
  font: 14px/1.5 "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-ink); text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #5b7cf3; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 4vw, 42px); font-weight: 760; letter-spacing: -.04em; line-height: 1.2; }
h2 { font-size: 19px; font-weight: 720; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 22px; font-weight: 760; width: max-content; }
.brand-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: white; }
.brand-icon .icon { width: 24px; height: 24px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 40px; padding: 8px 14px; border: 1px solid #dce4f1; border-radius: 9px; background: white; color: var(--ink); font-weight: 640; text-align: center; white-space: nowrap; }
.btn:hover, .icon-button:hover { background: #f1f5ff; border-color: #d2def9; }
.btn.primary { color: white; background: var(--blue); border-color: var(--blue); }
.btn.primary:hover { background: #1c40bd; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--dim); flex: 0 0 auto; }
.icon-button.starred { color: #966006; }
.icon-button.starred svg { fill: #ffd882; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 25px; padding: 26px 16px 16px; background: white; border-right: 1px solid var(--line); min-width: 0; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.sidebar .brand { margin-left: 10px; }
.sidebar nav { flex: 1; overflow: auto; padding: 2px; }
.nav-label { font-size: 11px; color: var(--muted); font-weight: 700; margin: 15px 10px 7px; }
.nav-link { display: flex; align-items: center; gap: 11px; color: var(--dim); padding: 9px 11px; min-height: 43px; margin: 2px 0; border-radius: 9px; font-weight: 620; }
.nav-link:hover { background: #f4f6fb; }
.nav-link[aria-current="page"] { color: var(--blue-ink); background: var(--blue-soft); font-weight: 740; }
.sidebar-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 14px 3px 3px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #3d4bb5; background: #eef0ff; font-weight: 740; }
.sidebar-foot strong, .sidebar-foot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot small { color: var(--muted); }
.main { min-width: 0; }
.topbar { height: 68px; padding: 0 clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--line); background: var(--white); display: flex; justify-content: space-between; align-items: center; color: var(--dim); font-weight: 660; }
#transfer-indicator a { display: flex; align-items: center; gap: 6px; background: var(--blue-soft); padding: 6px 11px; border-radius: 7px; }
.view { max-width: 1550px; margin: 0 auto; padding: 29px clamp(18px, 4vw, 56px) 60px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.view-head p, .muted { color: var(--muted); }
.view-head p { margin-top: 7px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search { position: relative; display: flex; align-items: center; }
.search > .icon { position: absolute; left: 11px; color: var(--muted); }
.search input { padding-left: 37px; width: min(235px, 38vw); }
input:not([type="file"]), select { min-height: 40px; border: 1px solid #d9e2f1; border-radius: 8px; padding: 8px 11px; background: white; color: var(--ink); }
.search input { padding-left: 37px; }
input::placeholder { color: #586a84; }
.folder-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin: 0 0 24px; }
.folder-card { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 15px; text-align: left; color: var(--ink); font-weight: 710; min-height: 96px; }
.folder-card:hover { border-color: #adc0f7; box-shadow: 0 4px 12px #263a7410; }
.folder-drop-active { outline: 2px solid var(--blue); outline-offset: 2px; background: var(--blue-soft); }
[draggable="true"].file-link { cursor: grab; }
[draggable="true"].file-link:active { cursor: grabbing; }
.tile { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #3356c9; background: #edf1ff; flex: 0 0 auto; }
.tile.music { color: #874397; background: #f8ebfc; }
.tile.images { color: #147a64; background: #dff7ef; }
.tile.video { color: #906016; background: #fff1d8; }
.tile.other { color: #56627d; background: #eef1f6; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--dim); }
.crumbs button { padding: 2px 4px; background: transparent; border: 0; color: var(--blue-ink); }
.panel { border: 1px solid var(--line); border-radius: 13px; background: white; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; gap: 12px; }
.table-wrap { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; text-align: left; }
.data th { background: #f8faff; color: var(--dim); font-size: 12px; font-weight: 690; }
.data td, .data th { padding: 9px 13px; border-top: 1px solid var(--line); }
.data td:first-child, .data th:first-child { padding-left: 17px; }
.data td:last-child, .data th:last-child { padding-right: 17px; }
.data td { height: 53px; }
.data tr:hover td { background: #fbfcff; }
.data .meta { white-space: nowrap; color: var(--dim); font-variant-numeric: tabular-nums; }
.data .select-cell { width: 42px; padding-right: 2px; }
.select-cell input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; vertical-align: middle; accent-color: var(--blue); cursor: pointer; }
.selection-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 13px; border: 1px solid #cfdbfa; border-radius: 9px; background: var(--blue-soft); }
.selection-tools strong { margin-right: 6px; }
.file-link { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 650; text-align: left; background: transparent; padding: 0; border: 0; overflow-wrap: anywhere; }
.file-link:hover { color: var(--blue-ink); }
.file-link .tile { width: 30px; height: 30px; }
.image-thumb { display: grid; place-items: center; position: relative; overflow: hidden; width: 80px; height: 60px; border: 1px solid var(--line); border-radius: 8px; background: #eef2f9; flex: 0 0 auto; }
.image-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; color: transparent; }
.row-actions { justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
.empty { padding: 38px 18px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.empty svg { display: block; margin: 0 auto 9px; width: 31px; height: 31px; color: #627dbd; }
.entry { width: min(920px, 94vw); min-height: min(490px, 86vh); display: grid; grid-template-columns: .95fr 1fr; border-radius: 21px; overflow: hidden; background: var(--white); border: 1px solid var(--line); box-shadow: 0 24px 78px #1d3d8218; margin: max(6vh, 24px) auto; }
.entry-visual { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(22px, 4vw, 40px); position: relative; isolation: isolate; overflow: hidden; color: white; background: linear-gradient(143deg, #213d9f 0%, #2850d0 65%, #426df2 100%); }
.entry-visual .brand { color: white; }
.entry-visual .brand-icon { background: #ffffff21; }
.entry-art { display: grid; place-items: center; aspect-ratio: 1; width: min(70%, 220px); align-self: center; border: 1px solid #ffffff3d; border-radius: 50%; background: #ffffff0d; box-shadow: 0 0 0 20px #ffffff0c, 0 0 0 43px #ffffff09; }
.entry-art .icon { width: min(20vw, 120px); height: min(20vw, 120px); stroke-width: 1.1; filter: drop-shadow(0 8px 12px #071b8050); }
.entry-visual p { font-size: 17px; font-weight: 620; }
.entry-content { padding: clamp(25px, 5vw, 52px); align-content: center; overflow-wrap: anywhere; }
.entry-content h1 { margin-bottom: 9px; }
.entry-content > p, .dialog-description { color: var(--muted); margin-bottom: 17px; }
.fields { display: grid; gap: 13px; }
.field { display: grid; gap: 5px; min-width: 0; font-weight: 640; }
.field input, .field select { width: 100%; font-weight: 400; }
.fields > .btn { justify-self: start; }
.form-error { color: var(--danger) !important; min-height: 1.45em; }
.copy-helper { position: fixed; left: -200vw; top: 0; }
.dialog-form .form-error:empty { display: none; }
dialog { width: min(480px, 94vw); max-height: 88vh; padding: 0; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 22px 65px #0c173b36; color: var(--ink); }
dialog::backdrop { background: #1423407a; }
dialog.wide { width: min(880px, 95vw); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 15px 19px; gap: 10px; background: white; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dialog-body { padding: 18px 20px 22px; }
.dialog-body > .actions { margin-top: 16px; }
.dialog-form .actions { justify-content: flex-end; }
.menu-list { display: grid; gap: 8px; }
.menu-list .btn { justify-content: flex-start; }
.preview { display: grid; place-items: center; min-height: 150px; padding: 10px; background: #eff3fc; border-radius: 10px; }
.preview img, .preview video, .preview audio { max-width: 100%; }
.preview img, .preview video { max-height: 58vh; object-fit: contain; }
.preview video, .preview audio { width: 100%; }
.lyrics { display: grid; gap: 8px; }
.lyric-lines { display: grid; max-height: min(27vh, 230px); overflow: auto; overscroll-behavior: contain; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; }
.lyric-line { padding: 8px; border: 0; border-radius: 7px; background: transparent; color: var(--dim); text-align: center; overflow-wrap: anywhere; }
button.lyric-line:hover { background: var(--canvas); }
.lyric-line[aria-current="true"] { background: var(--blue-soft); color: var(--blue-ink); font-weight: 750; }
.drop-hint { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; padding: 10px 13px; border: 1px dashed #b9c9e7; border-radius: 9px; color: var(--dim); }
.drop-active .drop-hint { background: var(--blue-soft); color: var(--blue-ink); border-color: var(--blue); }
.status { display: inline-block; padding: 4px 8px; color: var(--dim); background: #eef2f8; border-radius: 7px; font-weight: 640; font-size: 12px; white-space: nowrap; }
.status.good { color: var(--good); background: #e3f6ed; }
.status.active { color: var(--blue-ink); background: var(--blue-soft); }
.status.warn { color: #8a4a11; background: #fff0dc; }
progress { height: 8px; width: min(140px, 20vw); max-width: 100%; accent-color: var(--blue); display: block; }
.task-progress { display: grid; gap: 5px; font-size: 12px; color: var(--dim); }
.task-speed { color: var(--blue-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
#toast { position: fixed; z-index: 2; right: 18px; bottom: 18px; padding: 11px 15px; border-radius: 10px; background: #172750; color: white; max-width: min(460px, 88vw); box-shadow: 0 10px 25px #16213a31; overflow-wrap: anywhere; }
#toast.error { background: #82233a; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 185px minmax(0, 1fr); }
  .view-head { align-items: flex-start; flex-direction: column; }
  .folder-grid { gap: 8px; }
  .folder-card { padding: 11px; }
}
@media (max-width: 670px) {
  .shell { display: block; }
  .sidebar { height: auto; position: static; padding: 10px 12px; gap: 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; white-space: nowrap; order: 3; gap: 5px; overflow-x: auto; }
  .nav-label { display: none; }
  .nav-link { min-height: 36px; padding: 5px 9px; }
  .sidebar .brand { margin-left: 2px; }
  .sidebar-foot { position: absolute; right: 11px; top: 10px; border: 0; padding: 0; max-width: 145px; }
  .topbar { height: 42px; }
  .view { padding-top: 19px; }
  .folder-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .folder-card { min-height: 71px; gap: 6px; }
  .search input { width: min(230px, 72vw); }
  .data td, .data th { padding: 8px 7px; }
  .data .hide-small { display: none; }
  .data td:first-child, .data th:first-child { padding-left: 10px; }
  .data td:last-child, .data th:last-child { padding-right: 10px; }
  .entry { display: block; margin-top: 5vh; }
  .entry-visual { padding: 16px 20px; }
  .entry-visual p, .entry-art { display: none; }
}
