:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei UI", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #edf3fc;
  background: #101520;
  --panel: #171f2d;
  --line: #2b3749;
  --muted: #a9b7cb;
  --accent: #63ddc1;
  --accent-ink: #112923;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button, .pick { cursor: pointer; }
button:disabled { opacity: .38; cursor: default; }
button:focus-visible, input:focus-visible, .pick:focus-within, .stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.masthead { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: #151d29; }
.identity { display: flex; align-items: center; gap: 13px; font-size: 17px; font-weight: 720; white-space: nowrap; }
.mark { width: 25px; height: 23px; display: inline-block; border: 1.5px solid var(--accent); border-radius: 5px; position: relative; margin-right: 2px; }
.mark::before { content: ""; position: absolute; left: 5px; top: 5px; width: 11px; height: 9px; border: 1px solid var(--accent); border-radius: 2px; }
.mast-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quiet, .pick { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #1d2736; color: #e7eef9; border-radius: 7px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.quiet:hover:enabled, .pick:hover { background: #2a3a4d; }
.pick { position: relative; }
.pick input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.connection { color: var(--muted); font-size: 12px; margin-right: 7px; white-space: nowrap; }
.connection::before { content: ""; background: #7b8ba2; width: 7px; height: 7px; display: inline-block; vertical-align: 1px; margin-right: 7px; border-radius: 50%; }
.connection[data-online="true"]::before { background: var(--accent); }
.layout { display: grid; grid-template-columns: clamp(195px, 19vw, 260px) minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { padding: 29px 16px; background: #141c29; border-right: 1px solid var(--line); }
.sidebar h2 { font-size: 13px; font-weight: 650; margin: 0 10px 15px; color: var(--muted); }
.sidebar nav { display: grid; gap: 7px; }
.batch-button { text-align: left; padding: 12px 10px; line-height: 1.5; border: 1px solid transparent; border-radius: 8px; color: #c7d3e4; background: transparent; overflow-wrap: anywhere; }
.batch-button:hover { background: #1c2839; }
.batch-button[aria-current="true"] { background: #1c3540; border-color: #366059; color: #eafdf7; }
.batch-button strong, .batch-button small { display: block; }
.batch-button small { color: #b0c3d3; margin-top: 3px; }
main { padding: 28px clamp(16px, 3.4vw, 52px) 38px; min-width: 0; }
.workspace-heading { display: flex; align-items: end; gap: 20px; justify-content: space-between; margin: 0 0 25px; }
h1 { font-size: clamp(25px, 3.4vw, 39px); letter-spacing: -.04em; line-height: 1.2; margin: 0 0 6px; }
.detail { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.overview { display: flex; align-items: baseline; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.overview strong { font-size: 31px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.controls { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; border-block: 1px solid var(--line); padding: 11px 0; margin-bottom: 19px; }
.groups, .filters { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.group { border: 1px solid transparent; border-radius: 7px; background: #172131; color: #b7c8da; padding: 6px 11px; font-size: 13px; }
.group:hover { border-color: #486177; }
.group[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); font-weight: 700; }
.zero-filter { color: #c3d0e0; font-size: 13px; display: flex; align-items: center; gap: 4px; padding: 0 6px; }
.zero-filter input { accent-color: var(--accent); }
input[type="search"] { width: min(210px, 56vw); padding: 7px 10px; border: 1px solid var(--line); background: #0e1622; color: #edf3fc; border-radius: 7px; font-size: 13px; }
.notice { background: #182334; border: 1px solid var(--line); color: #c3d3e5; padding: 16px; border-radius: 9px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr)); gap: 14px; }
.card { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: #edf3fc; text-align: left; overflow: hidden; }
.card:hover { border-color: var(--accent); }
.thumb { aspect-ratio: 1.38; position: relative; display: block; background: #0c1119; color: var(--muted); }
.thumb img { position: absolute; width: 100%; height: 100%; object-fit: contain; inset: 0; }
.thumb-state { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; font-size: 12px; }
.card-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 12px; }
.filename { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.count { background: #243145; color: #ceddef; border-radius: 4px; padding: 2px 6px; font-size: 11px; white-space: nowrap; }
.count[data-zero="true"] { color: #ffcf8f; background: #442f24; }
.paging { border-top: 1px solid var(--line); margin-top: 23px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.paging button + button { margin-left: 7px; }
dialog { border: 1px solid #344259; border-radius: 12px; padding: 0; color: #e7eef9; background: #151f2e; width: min(1260px, calc(100% - 26px)); height: min(900px, calc(100dvh - 26px)); }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgb(4 8 15 / .84); }
.viewer-toolbar, .viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px; flex-wrap: wrap; }
.viewer-toolbar h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.viewer-tools, .segmented { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.segmented { gap: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.segmented button { border: 0; background: #202b3b; padding: 7px 9px; color: #d7e5f7; font-size: 12px; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button:hover:enabled { background: #2a3a4d; }
.segmented button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); }
.stage { flex: 1; min-height: 0; overflow: auto; background: #090e16; position: relative; border-block: 1px solid var(--line); touch-action: none; overscroll-behavior: contain; }
.stage img { display: block; margin: auto; max-width: none; max-height: none; user-select: none; }
.stage[data-pannable="true"] { cursor: grab; }
.stage[data-dragging="true"] { cursor: grabbing; }
.viewer-status { display: grid; position: absolute; inset: 0; place-content: center; text-align: center; color: var(--muted); gap: 12px; pointer-events: none; }
.viewer-status button { pointer-events: auto; justify-self: center; }
.viewer-status[data-preview="true"] { inset: 8px 8px auto auto; padding: 5px 8px; border-radius: 5px; background: #101520dd; font-size: 12px; }
.viewer-footer { font-size: 13px; color: var(--muted); }
@media (max-width: 700px) {
  .masthead { padding: 10px 13px; flex-wrap: wrap; }
  .mast-actions { gap: 6px; }
  .layout { display: block; }
  .sidebar { padding: 10px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar h2 { margin: 0 0 5px; }
  .sidebar nav { display: flex; overflow: auto; }
  .batch-button { padding: 6px 9px; white-space: nowrap; }
  .batch-button strong, .batch-button small { display: inline; }
  .batch-button small { margin-left: 7px; }
  main { padding-top: 19px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 9px; }
  .viewer-toolbar, .viewer-footer { padding: 8px; }
}
