:root {
    color-scheme: light;
    --blue: #2037b8;
    --blue-deep: #1a2c96;
    --ice: #f4f7ff;
    --paper: #fbfcff;
    --grid: #cedbff;
    --grid-strong: #a8bdf5;
    --vermillion: #e95838;
    --ink: #17223d;
    --ink-soft: #34415f;
    --muted: #64728f;
    --muted-light: #9ba8c3;
    --line: #e0e6f3;
    --line-strong: #cbd5e8;
    --white: #fff;
    --success: #247452;
    --danger: #b94332;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
    --sans: "Noto Sans SC", "Microsoft YaHei", sans-serif;
    --radius-sm: 5px;
    --radius-md: 9px;
    --radius-lg: 14px;
    --shadow-dialog: 0 24px 64px rgba(23, 34, 61, 0.2), 0 4px 16px rgba(23, 34, 61, 0.12);
    font-family: var(--sans);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--ice);
    color: var(--ink);
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; scrollbar-color: #9ba9cb #eef2fb; scrollbar-width: thin; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
::selection { color: #fff; background: var(--blue); }
:focus-visible { outline: 3px solid #ee7657; outline-offset: 3px; }
[hidden] { display: none !important; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; color: var(--blue); }
.brand-mark svg { width: 30px; height: 30px; }
.brand-word { font-size: 20px; font-weight: 750; letter-spacing: -0.045em; }
.brand-edition { margin-left: 4px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.3); font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #cad4f5; }

/* Account entry */
.is-auth { background: var(--paper); }
.auth-layout { display: grid; grid-template-columns: minmax(440px, 1.13fr) minmax(450px, .87fr); min-height: 100vh; min-height: 100dvh; }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; padding: clamp(28px, 4vw, 64px); overflow: hidden; background: var(--blue); color: #fff; isolation: isolate; }
.auth-story::before { position: absolute; z-index: -1; inset: 0; content: ""; opacity: .16; background-image: linear-gradient(to right, transparent calc(100% - 1px), #b8c6ff calc(100% - 1px)), linear-gradient(to bottom, transparent calc(100% - 1px), #b8c6ff calc(100% - 1px)); background-size: 48px 48px; mask-image: linear-gradient(145deg, transparent 8%, #000 82%); }
.brand-on-blue { color: #fff; }
.brand-on-blue .brand-mark { color: #fff; }
.brand-on-blue .brand-word { font-size: 22px; }
.story-copy { max-width: 590px; margin: auto 0 26px; padding-top: clamp(40px, 6vh, 78px); }
.story-copy h1 { max-width: 10em; margin: 0; font-size: clamp(42px, 4.7vw, 66px); line-height: 1.22; letter-spacing: -.06em; font-weight: 730; text-wrap: balance; }
.story-copy p { max-width: 34ch; margin: 24px 0 0; color: #dbe4ff; font-size: 15px; line-height: 1.95; }
.auth-index { position: relative; display: grid; width: min(100%, 594px); grid-template-columns: repeat(7, minmax(0,1fr)); grid-auto-rows: clamp(32px, 3.6vw, 48px); gap: 6px; padding: 10px; border: 1px solid rgba(231,237,255,.38); background: rgba(13,31,133,.22); }
.auth-index::before, .auth-index::after { position: absolute; content: ""; pointer-events: none; }
.auth-index::before { inset: 0; background-image: linear-gradient(rgba(234,239,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(234,239,255,.1) 1px, transparent 1px); background-size: 25% 25%; }
.index-mark { position: relative; display: block; border: 1px solid rgba(238,243,255,.3); background: rgba(225,234,255,.05); }
.index-mark-0,.index-mark-7 { background: #e95838; border-color: #e95838; }
.index-mark-2,.index-mark-9 { background: #cddaff; border-color: #cddaff; }
.index-mark-4,.index-mark-11 { background: rgba(247,249,255,.32); }
.index-mark-5 { border-color: transparent; background: transparent; }
.index-mark-8 { background: rgba(219,227,255,.13); }
.index-mark-12 { border: 2px solid #b7c7ff; }
.index-key { position: absolute; right: 13px; bottom: 12px; padding: 4px 7px; background: var(--blue); color: #fff; font-size: 11px; }
.story-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 26px; color: #ced9ff; font-size: 12px; letter-spacing: .03em; }
.story-orbit { width: 34px; height: 1px; background: #e95838; }
.auth-side { display: grid; place-items: center; padding: 48px clamp(28px, 5vw, 80px); background: var(--paper); }
.auth-side-inner { width: min(100%, 390px); }
.auth-mobile-brand { display: none; }
.auth-heading { margin-bottom: 34px; }
.auth-heading h2 { margin: 0; font-size: clamp(28px, 2.6vw, 36px); line-height: 1.35; letter-spacing: -.045em; font-weight: 710; }
.auth-heading p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.auth-form { display: flex; flex-direction: column; align-items: flex-start; }
.field-label { margin: 19px 0 8px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.text-field, .select-field, .textarea-field { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); outline: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.text-field::placeholder, .textarea-field::placeholder { color: var(--muted); opacity: 1; }
.text-field:focus, .select-field:focus, .textarea-field:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(32,55,184,.12); }
.field-short { max-width: 124px; }
.form-notice { margin: -12px 0 18px; padding: 11px 13px; border: 1px solid #e3a796; background: #fff5f1; color: #8c3328; font-size: 13px; line-height: 1.6; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 650; line-height: 1; text-decoration: none; white-space: nowrap; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms ease, box-shadow 150ms ease; }
.button svg { width: 17px; height: 17px; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--blue-deep); box-shadow: 0 5px 14px rgba(32,55,184,.18); }
.button-secondary { border-color: var(--line-strong); background: #fff; color: var(--ink-soft); }
.button-secondary:hover:not(:disabled) { border-color: var(--grid-strong); background: #f8faff; color: var(--blue); }
.button-danger { border-color: #efc4bb; background: #fff8f6; color: var(--danger); }
.button-danger:hover { background: #fff0ec; }
.auth-submit { width: 100%; min-height: 50px; justify-content: space-between; margin-top: 28px; padding: 0 17px; font-size: 14px; }
.button-cue { font-family: var(--sans); font-size: 17px; font-weight: 400; }
.button-cue svg { width: 17px; height: 17px; transform: rotate(-45deg); }
.auth-switch { margin-top: 26px; color: var(--muted); font-size: 13px; }
.auth-switch a { margin-left: 5px; color: var(--blue); font-weight: 650; }
.auth-footnote { margin: 38px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

@media (min-width: 821px) and (max-height: 780px) {
    .auth-story { padding-top: 27px; padding-bottom: 23px; }
    .story-copy { margin-bottom: 18px; padding-top: 28px; }
    .story-copy h1 { font-size: clamp(39px, 4.4vw, 58px); }
    .story-copy p { margin-top: 13px; line-height: 1.7; }
    .auth-index { grid-auto-rows: clamp(22px, 3vh, 28px); gap: 4px; padding: 8px; }
    .story-bottom { padding-top: 14px; }
    .auth-side { padding-top: 26px; padding-bottom: 26px; }
    .auth-heading { margin-bottom: 23px; }
    .auth-footnote { margin-top: 22px; }
}

/* File workspace */
.is-app { min-height: 100vh; background: var(--ice); }
.app-shell { display: grid; grid-template-columns: 254px minmax(0,1fr) 0; min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; width: 254px; height: 100vh; height: 100dvh; padding: 24px 15px 15px; overflow: auto; background: var(--ink); color: #eef2ff; scrollbar-color: #465273 #17223d; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 28px; }
.sidebar .brand { color: #fff; }
.sidebar .brand-mark { color: #d2ddff; }
.sidebar .brand-word { font-size: 19px; }
.upload-wide { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 45px; margin-bottom: 23px; padding: 0 12px; border: 1px solid rgba(204,217,255,.45); border-radius: var(--radius-sm); background: #fff; color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 700; transition: background-color 150ms ease, border-color 150ms ease; }
.upload-wide:hover { border-color: #fff; background: #eff3ff; }
.upload-wide svg { width: 18px; height: 18px; }
.upload-shortcut { display: grid; place-items: center; width: 21px; height: 21px; margin-left: auto; border: 1px solid #d8e0f3; border-radius: 3px; color: var(--muted); font-size: 12px; }
.primary-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: #c1cbe3; text-align: left; cursor: pointer; font-size: 12px; transition: background-color 140ms ease, color 140ms ease; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item:hover { background: rgba(225,232,255,.09); color: #fff; }
.nav-item.is-active { background: #2d3d73; color: #fff; }
.nav-count { margin-left: auto; color: #a9b7db; font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-section-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 8px 8px; color: #92a0c4; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.small-icon-button, .icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: inherit; cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease; }
.small-icon-button { width: 25px; height: 25px; flex-basis: 25px; color: #c9d3ed; }
.small-icon-button svg { width: 16px; height: 16px; }
.small-icon-button:hover, .sidebar .icon-button:hover { border-color: rgba(214,225,255,.25); background: rgba(226,234,255,.09); color: #fff; }
.folder-nav, .saved-searches { display: flex; flex-direction: column; gap: 2px; }
.folder-item, .saved-search-item { display: flex; align-items: center; gap: 9px; min-height: 35px; padding: 0 9px; overflow: hidden; border-radius: 4px; background: transparent; color: #bbc6df; cursor: pointer; text-align: left; font-size: 11px; }
.folder-item:hover, .saved-search-item:hover { background: rgba(225,232,255,.08); color: #fff; }
.folder-item.is-active { background: #2d3d73; color: #fff; }
.folder-item svg, .saved-search-item svg { width: 15px; height: 15px; flex: 0 0 15px; }
.folder-item span, .saved-search-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-level-1 { padding-left: 21px; }
.sidebar-hint { margin: 2px 9px; color: #8996b5; font-size: 11px; line-height: 1.7; }
.saved-head { margin-top: 22px; }
.sidebar-spacer { min-height: 18px; flex: 1 0 16px; }
.storage-meter { padding: 14px 9px 15px; border-top: 1px solid rgba(208,220,255,.17); }
.storage-caption { display: flex; justify-content: space-between; gap: 10px; color: #cad3e9; font-size: 11px; }
.storage-caption span:last-child { color: #9ba9c9; font-variant-numeric: tabular-nums; }
.storage-track { height: 4px; margin-top: 10px; overflow: hidden; border-radius: 10px; background: #354365; }
.storage-track span { display: block; width: 100%; height: 100%; background: #e95838; transform: scaleX(var(--usage, 0)); transform-origin: left center; transition: transform 200ms var(--ease-out); }
.storage-meter p { margin: 9px 0 0; color: #94a2c1; font-size: 11px; line-height: 1.6; }
.account-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 3px 0; border-top: 1px solid rgba(208,220,255,.17); }
.avatar, .profile-toggle { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: #e1e8ff; color: var(--blue); font-size: 12px; font-weight: 750; }
.account-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 2px; }
.account-copy strong { overflow: hidden; color: #f2f4fb; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: #94a2c1; font-size: 11px; }
.logout-button { color: #a5b1cb; }
.logout-button svg { width: 17px; height: 17px; }
.mobile-close, .menu-toggle, .profile-toggle, .sidebar-scrim { display: none; }

.workspace { min-width: 0; padding: 0 clamp(24px, 3.2vw, 52px) 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 25px; min-height: 74px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 180px; color: var(--muted); font-size: 11px; }
.breadcrumb svg { width: 13px; height: 13px; color: #a4aec2; }
.breadcrumb strong { color: var(--ink-soft); font-weight: 650; }
.search-box { display: flex; align-items: center; gap: 9px; width: min(100%, 382px); height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: #7e8ca7; }
.search-box > svg { width: 17px; height: 17px; flex: 0 0 17px; }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(32,55,184,.1); }
.search-box kbd { padding: 2px 5px; border: 1px solid #d8dfec; border-radius: 3px; background: var(--ice); color: #64728f; font-family: var(--sans); font-size: 11px; }
.content-frame { width: min(100%, 1460px); margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; padding: 33px 0 25px; }
.page-heading h1 { margin: 0; font-size: clamp(27px, 2.8vw, 36px); line-height: 1.22; letter-spacing: -.05em; font-weight: 720; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.heading-actions { display: flex; gap: 8px; }
.heading-actions .button { min-height: 38px; font-size: 11px; }
.heading-actions .button svg { width: 16px; height: 16px; }

.index-section { padding: 17px 19px 18px; border: 1px solid #bfd0ff; background: #e8eeff; }
.index-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.index-section-head h2, .files-heading-copy h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.015em; }
.index-section-head p { margin: 5px 0 0; color: #586789; font-size: 11px; line-height: 1.6; }
.index-pagination { color: #56678f; font-size: 11px; font-variant-numeric: tabular-nums; }
.file-index { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 5px; }
.index-cell { position: relative; display: flex; align-items: center; gap: 7px; min-width: 0; height: 33px; padding: 0 7px; overflow: hidden; border: 1px solid #c2d0f4; background: rgba(255,255,255,.58); color: #283c85; text-align: left; cursor: pointer; }
.index-cell:hover { border-color: var(--blue); background: #fff; }
.index-cell .index-cell-number { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.index-cell .index-cell-name { overflow: hidden; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.index-cell .index-cell-type { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--blue); }
.index-cell.is-image .index-cell-type { background: var(--vermillion); }
.index-cell.is-video .index-cell-type { background: #735ac7; }
.index-cell.is-archive .index-cell-type { background: #238061; }
.index-cell.is-empty { pointer-events: none; background: rgba(255,255,255,.24); }
.index-cell.is-empty .index-cell-number { color: #94a5d3; }
.index-cell.is-empty:nth-child(3n) { border-color: #aabef2; }

.files-section { margin-top: 34px; }
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; border-bottom: 1px solid var(--line-strong); }
.files-heading-copy { display: flex; align-items: baseline; gap: 11px; }
.files-heading-copy h2 { font-size: 15px; }
.files-heading-copy > span { color: var(--muted); font-size: 11px; }
.list-tools { display: flex; align-items: center; gap: 8px; }
.type-filter { height: 31px; max-width: 112px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); cursor: pointer; font: inherit; font-size: 11px; }
.list-tool { width: 32px; height: 32px; color: var(--muted); }
.list-tool:hover { border-color: var(--line); background: #fff; color: var(--blue); }
.list-tool svg { width: 16px; height: 16px; }
.view-toggle { display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 9px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.view-toggle:hover { border-color: var(--line); background: #fff; }
.view-toggle svg { width: 13px; height: 13px; transform: rotate(90deg); }
.file-table-wrap { position: relative; min-height: 260px; }
.workspace.is-drop-target::after { position: fixed; z-index: 25; inset: 12px; display: grid; place-items: center; border: 2px dashed #98adeb; background: rgba(244,247,255,.94); color: var(--blue); content: "松开即可上传文件"; font-size: 17px; font-weight: 700; pointer-events: none; }
.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-table th { height: 38px; color: var(--muted); font-size: 11px; font-weight: 600; text-align: left; }
.file-table th:first-child, .file-table td:first-child { padding-left: 9px; }
.name-column { width: 58%; }
.modified-column { width: 23%; }
.size-column { width: 14%; }
.row-menu-column { width: 42px; }
.file-table td { height: 61px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.file-row { cursor: pointer; transition: background-color 130ms ease; }
.file-row:hover { background: rgba(255,255,255,.72); }
.file-row.is-selected { background: #e8eeff; }
.file-name-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-symbol { display: grid; place-items: center; width: 34px; height: 38px; flex: 0 0 34px; border: 1px solid #c7d5f4; border-radius: 3px; background: #fff; color: var(--blue); }
.file-symbol svg { width: 18px; height: 18px; }
.file-symbol.kind-image { border-color: #f2c4b9; background: #fff6f3; color: var(--vermillion); }
.file-symbol.kind-video { border-color: #d7cbf5; background: #f8f5ff; color: #755cc5; }
.file-symbol.kind-archive { border-color: #bddccf; background: #f1fbf6; color: #287a5b; }
.file-symbol.kind-audio { border-color: #ecd9ac; background: #fffbec; color: #98701b; }
.file-copy { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.file-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-star { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; background: transparent; color: #8e9ab3; cursor: pointer; vertical-align: middle; }
.row-star.is-starred { color: var(--vermillion); }
.row-star svg { width: 14px; height: 14px; }
.file-date, .file-size { color: var(--muted) !important; font-size: 11px !important; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; justify-content: flex-end; padding-right: 5px; }
.row-actions .icon-button { width: 30px; height: 30px; color: #7e8ba6; }
.row-actions svg { width: 17px; height: 17px; }
.empty-state { position: absolute; inset: 39px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 221px; padding: 30px 20px; text-align: center; }
.empty-art { display: grid; grid-template-columns: repeat(3, 20px); gap: 4px; margin-bottom: 17px; transform: rotate(-7deg); }
.empty-art span { width: 20px; height: 20px; border: 1px solid #b7c7ed; background: #e9efff; }
.empty-art span:nth-child(2), .empty-art span:nth-child(6) { background: #fff; }
.empty-art span:nth-child(4) { background: var(--vermillion); border-color: var(--vermillion); }
.empty-art span:nth-child(8) { background: #cad7ff; }
.empty-state h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.empty-state p { max-width: 42ch; margin: 8px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.empty-state .button { min-height: 36px; font-size: 11px; }
.empty-state .button svg { width: 15px; height: 15px; }
.load-more { display: block; min-height: 36px; margin: 5px auto 0; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink-soft); cursor: pointer; font-size: 11px; }
.load-more:hover { border-color: var(--grid-strong); color: var(--blue); }
.activity-line { min-height: 30px; margin-top: 8px; color: var(--muted); font-size: 11px; }

/* Detail rail and dialogs */
.app-shell.has-details { grid-template-columns: 254px minmax(0,1fr) 310px; }
.details-panel { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; border-left: 1px solid var(--line); background: #fff; }
.details-header { display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: 0 17px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 700; }
.details-header .icon-button { color: var(--muted); }
.details-header .icon-button:hover { background: var(--ice); color: var(--blue); }
.details-body { padding: 20px 18px; }
.details-symbol { display: grid; place-items: center; width: 64px; height: 73px; margin: 0 auto 16px; border: 1px solid var(--grid-strong); background: #edf2ff; color: var(--blue); }
.details-symbol svg { width: 30px; height: 30px; }
.details-name { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; font-weight: 680; line-height: 1.5; text-align: center; }
.details-meta { margin: 6px 0 17px; color: var(--muted); font-size: 11px; text-align: center; }
.detail-actions { display: flex; justify-content: center; gap: 7px; margin-bottom: 22px; }
.detail-actions .button { min-height: 35px; padding: 0 10px; font-size: 11px; }
.detail-actions .button svg { width: 15px; height: 15px; }
.detail-block { padding: 15px 0; border-top: 1px solid var(--line); }
.detail-block h3 { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.detail-info { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 9px 10px; font-size: 11px; }
.detail-info dt { color: #78859e; }
.detail-info dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 0 7px; border: 1px solid #cfdaef; border-radius: 3px; background: #f5f8ff; color: #3b4f84; font-size: 11px; }
.detail-input { width: 100%; min-height: 34px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); font-size: 11px; }
.detail-input::placeholder { color: var(--muted); opacity: 1; }
.detail-input:focus { border-color: var(--blue); outline: 2px solid rgba(32,55,184,.12); }
.detail-description { min-height: 69px; resize: vertical; line-height: 1.6; }
.detail-save { margin-top: 7px; min-height: 29px; padding: 0 9px; font-size: 11px; }
.danger-action { display: flex; width: 100%; justify-content: flex-start; min-height: 34px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--danger); cursor: pointer; font-size: 11px; }
.danger-action:hover { background: #fff2ee; }
.file-detail-mobile-close { display: none; }

.dialog { width: min(100vw - 32px, 480px); max-height: min(90dvh, 760px); padding: 28px; border: 1px solid #d5deef; border-radius: var(--radius-md); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-dialog); }
.dialog::backdrop { background: rgba(14, 24, 52, .52); }
.dialog[open] { animation: dialog-enter 180ms var(--ease-out) both; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dialog-dismiss { position: absolute; top: 13px; right: 13px; }
.dialog-dismiss button { color: var(--muted); }
.dialog-dismiss button:hover { background: var(--ice); color: var(--blue); }
.dialog h2 { max-width: 90%; margin: 0 0 8px; font-size: 22px; letter-spacing: -.04em; }
.dialog-intro { margin: 0 0 23px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.dialog-form { display: flex; flex-direction: column; gap: 9px; }
.dialog-form .field-label { margin-top: 7px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.dialog-actions .button { min-height: 38px; }
.dialog-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.share-link-output { display: flex; gap: 7px; margin-top: 15px; }
.share-link-output input { flex: 1; min-width: 0; height: 38px; padding: 0 9px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft); font-size: 11px; }
.preview-dialog { display: flex; flex-direction: column; width: min(95vw, 1060px); height: min(92dvh, 850px); max-height: 92dvh; padding: 0; overflow: hidden; background: #eef2fb; }
.preview-dialog::backdrop { background: rgba(14,24,52,.76); }
.preview-bar { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 0 14px 0 19px; border-bottom: 1px solid var(--line); background: #fff; }
.preview-bar strong { flex: 1; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar form { display: flex; }
.preview-stage { display: grid; flex: 1; place-items: center; min-height: 0; padding: 18px; overflow: auto; }
.preview-stage img, .preview-stage iframe { display: block; max-width: 100%; max-height: 100%; border: 0; background: #fff; box-shadow: 0 8px 30px rgba(23,34,61,.15); }
.preview-stage img { object-fit: contain; }
.preview-stage iframe { width: 100%; height: 100%; }

/* Uploads and share manager */
.upload-tray { position: fixed; z-index: 30; right: 25px; bottom: 22px; width: min(390px, calc(100vw - 32px)); max-height: min(70dvh, 440px); overflow: hidden; border: 1px solid #c8d3e9; border-radius: 8px; background: #fff; box-shadow: 0 12px 34px rgba(23,34,61,.18); }
.upload-tray > header { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 13px 0 16px; border-bottom: 1px solid var(--line); }
.upload-tray > header > div { display: flex; align-items: baseline; gap: 9px; }
.upload-tray > header strong { font-size: 12px; }
.upload-tray > header span { color: var(--muted); font-size: 11px; }
.upload-tray > header .icon-button { color: var(--muted); }
.upload-items { max-height: calc(min(70dvh, 440px) - 52px); padding: 3px 13px 8px; overflow-y: auto; }
.upload-item { padding: 11px 2px 10px; border-bottom: 1px solid var(--line); }
.upload-item:last-child { border-bottom: 0; }
.upload-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.upload-item-name { overflow: hidden; color: var(--ink-soft); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-status { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.upload-item-status.is-error { color: var(--danger); }
.upload-progress { height: 3px; margin-top: 7px; overflow: hidden; background: #e7ebf4; }
.upload-progress span { display: block; width: 100%; height: 100%; background: var(--blue); transform: scaleX(var(--progress, 0)); transform-origin: left center; transition: transform 130ms linear; }
.share-list { display: flex; flex-direction: column; }
.share-row { display: grid; grid-template-columns: minmax(150px,1fr) minmax(100px,170px) minmax(85px,120px) auto; align-items: center; gap: 17px; min-height: 67px; border-bottom: 1px solid var(--line); }
.share-file-name { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); font-size: 11px; font-weight: 630; }
.share-file-name svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--blue); }
.share-file-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-state { color: #62708c; font-size: 11px; line-height: 1.6; }
.share-state.is-expired { color: var(--danger); }
.share-state.is-live { color: var(--success); }
.share-created { color: #61708a; font-size: 11px; font-variant-numeric: tabular-nums; }
.share-actions { display: flex; justify-content: flex-end; gap: 4px; }
.share-actions .icon-button { width: 30px; height: 30px; color: var(--muted); }
.share-actions .icon-button:hover { background: #f0f4ff; color: var(--blue); }
.share-empty { padding: 55px 15px; color: var(--muted); font-size: 11px; text-align: center; }
.toast-stack { position: fixed; z-index: 50; right: 25px; bottom: 23px; display: flex; flex-direction: column; gap: 7px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid #c6d2e8; border-radius: 5px; background: var(--ink); color: #fff; box-shadow: 0 7px 18px rgba(23,34,61,.18); font-size: 11px; line-height: 1.6; opacity: 1; transform: translateY(0); transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translateY(6px); } }
.toast.is-error { border-color: #ebb7aa; background: #8d3428; }

@media (hover: hover) and (pointer: fine) {
    .index-cell, .file-row, .nav-item, .folder-item, .saved-search-item, .small-icon-button, .icon-button, .button { -webkit-tap-highlight-color: transparent; }
}

@media (max-width: 1320px) {
    .app-shell { grid-template-columns: 235px minmax(0,1fr) 0; }
    .sidebar { width: 235px; }
    .app-shell.has-details { grid-template-columns: 235px minmax(0,1fr) 285px; }
    .workspace { padding-right: 27px; padding-left: 27px; }
    .file-index { grid-template-columns: repeat(8, minmax(0,1fr)); }
    .name-column { width: 55%; }
    .modified-column { width: 25%; }
}

@media (max-width: 1060px) {
    .app-shell.has-details { grid-template-columns: 235px minmax(0,1fr); }
    .details-panel { position: fixed; z-index: 22; top: 0; right: 0; width: min(370px, calc(100vw - 26px)); box-shadow: -18px 0 36px rgba(23,34,61,.12); opacity: 1; transform: translateX(0); transition: opacity 190ms var(--ease-drawer), transform 190ms var(--ease-drawer); }
    @starting-style { .details-panel { opacity: .7; transform: translateX(14px); } }
    .share-row { grid-template-columns: minmax(120px,1fr) minmax(90px,135px) auto; }
    .share-created { display: none; }
}

@media (max-width: 820px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-story { min-height: 0; padding: 25px clamp(22px, 6vw, 48px) 20px; }
    .story-copy { margin: 45px 0 23px; padding-top: 0; }
    .story-copy h1 { max-width: 13ch; font-size: clamp(34px, 8vw, 56px); }
    .story-copy p { max-width: 44ch; margin-top: 13px; font-size: 12px; line-height: 1.8; }
    .auth-index { width: 100%; grid-auto-rows: 20px; gap: 4px; padding: 7px; }
    .index-key { right: 8px; bottom: 7px; font-size: 11px; }
    .story-bottom { padding-top: 13px; font-size: 12px; }
    .auth-side { padding: 39px 24px 52px; }
    .auth-side-inner { max-width: 420px; }
    .auth-mobile-brand { display: inline-flex; margin-bottom: 25px; }
    .auth-mobile-brand .brand-mark { color: var(--blue); }
    .auth-heading { margin-bottom: 26px; }
    .auth-heading h2 { font-size: 29px; }
    .auth-footnote { margin-top: 28px; }
    .app-shell, .app-shell.has-details { display: block; }
    .sidebar { position: fixed; z-index: 40; top: 0; left: 0; width: min(290px, calc(100vw - 48px)); transform: translateX(-102%); opacity: 0; transition: transform 220ms var(--ease-drawer), opacity 180ms ease-out; }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); opacity: 1; }
    .sidebar-scrim { position: fixed; z-index: 39; inset: 0; display: block; border: 0; background: rgba(17,28,56,.5); opacity: 0; visibility: hidden; transition: opacity 180ms ease, visibility 180ms ease; }
    .app-shell.sidebar-open .sidebar-scrim { opacity: 1; visibility: visible; }
    .mobile-close, .menu-toggle { display: inline-grid; }
    .workspace { padding: 0 clamp(17px, 4vw, 30px) 40px; }
    .topbar { min-height: 62px; gap: 12px; }
    .menu-toggle { width: 32px; height: 32px; flex-basis: 32px; color: var(--ink-soft); }
    .breadcrumb { flex: 1; min-width: 0; gap: 4px; font-size: 11px; }
    .breadcrumb > span { display: none; }
    .search-box { width: min(46vw, 290px); height: 35px; padding: 0 8px; }
    .search-box input { font-size: 11px; }
    .search-box kbd { display: none; }
    .profile-toggle { display: grid; width: 30px; height: 30px; flex-basis: 30px; border: 0; }
    .page-heading { align-items: flex-start; padding: 25px 0 20px; }
    .page-heading h1 { font-size: 29px; }
    .page-heading p { max-width: 34ch; font-size: 11px; line-height: 1.6; }
    .heading-actions .button { width: 38px; height: 38px; min-height: 38px; padding: 0; }
    .heading-actions .button span { display: none; }
    .heading-actions .button svg { width: 17px; height: 17px; }
    .index-section { padding: 13px; }
    .file-index { grid-template-columns: repeat(6, minmax(0,1fr)); gap: 4px; }
    .index-cell { height: 30px; gap: 5px; padding: 0 5px; }
    .index-cell .index-cell-name { font-size: 11px; }
    .files-section { margin-top: 25px; }
    .modified-column { width: 22%; }
    .size-column { width: 13%; }
    .file-table td { height: 56px; }
    .file-symbol { width: 30px; height: 34px; flex-basis: 30px; }
    .file-symbol svg { width: 16px; height: 16px; }
}

@media (max-width: 560px) {
    .auth-story { padding-right: 19px; padding-left: 19px; }
    .auth-index { grid-template-columns: repeat(7, minmax(0,1fr)); }
    .story-bottom { font-size: 12px; }
    .auth-side { padding: 32px 20px 45px; }
    .workspace { padding-right: 15px; padding-left: 15px; }
    .breadcrumb { display: none; }
    .topbar { justify-content: initial; gap: 8px; }
    .search-box { flex: 1; width: auto; }
    .page-heading { gap: 10px; }
    .page-heading h1 { font-size: 26px; }
    .page-heading p { max-width: 27ch; }
    .heading-actions { gap: 5px; }
    .heading-actions .button { width: 34px; height: 34px; min-height: 34px; }
    .index-section-head h2 { font-size: 12px; }
    .index-section-head p { max-width: 28ch; font-size: 11px; }
    .file-index { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .index-cell { height: 29px; }
    .index-cell .index-cell-number { display: none; }
    .files-head { min-height: 43px; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
    .list-tools { margin-left: auto; }
    .type-filter { max-width: 96px; }
    .files-heading-copy { gap: 7px; }
    .files-heading-copy h2 { font-size: 13px; }
    .files-heading-copy > span { font-size: 11px; }
    .view-toggle { padding: 0 5px; font-size: 11px; }
    .file-table th { height: 33px; font-size: 11px; }
    .name-column { width: auto; }
    .modified-column { width: 76px; }
    .size-column { width: 0; }
    .row-menu-column { width: 33px; }
    .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; }
    .file-table td { height: 56px; font-size: 11px; }
    .file-table td:first-child { padding-left: 3px; }
    .file-name-cell { gap: 7px; }
    .file-symbol { width: 27px; height: 31px; flex-basis: 27px; }
    .file-copy strong { font-size: 11px; }
    .file-copy small { font-size: 11px; }
    .file-date { font-size: 11px !important; }
    .row-actions .icon-button { width: 26px; height: 30px; }
    .share-row { grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; padding: 11px 0; }
    .share-state { grid-column: 1; grid-row: 2; font-size: 11px; }
    .share-actions { grid-column: 2; grid-row: 1 / span 2; }
    .dialog { padding: 23px 19px; }
    .dialog h2 { font-size: 20px; }
    .dialog-dismiss { top: 8px; right: 8px; }
    .toast-stack { right: 16px; bottom: 16px; }
    .upload-tray { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    html, body { scroll-behavior: auto !important; }
    .dialog[open] { animation: none; }
    .sidebar { transition: opacity 120ms ease; }
    .sidebar-scrim { transition: opacity 120ms ease; }
    .details-panel { transform: none; transition: opacity 120ms ease; }
    .toast { transform: none; transition: opacity 120ms ease; }
    .storage-track span, .upload-progress span { transition: none; }
    @starting-style { .details-panel, .toast { opacity: 0; transform: none; } }
}

