/* OfficeNAS vault layout. Shares the exact CDS tokens and logo with the case-materials site. */
/* Vault data and crypto code remain isolated from FileBrowser's unauthenticated APIs. */
:root {
  color-scheme: light;
  --bg: var(--cds-page-bg);
  --surface: var(--cds-surface-2);
  --text: var(--cds-text-primary);
  --muted: var(--cds-text-secondary);
  --line: var(--cds-border);
  --accent: var(--cds-fill-brand);
  --accent-text: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
    --bg: #f9f9f7;
    --surface: #fff;
    --text: #0b0b0b;
    --muted: #52514e;
    --line: rgba(11,11,11,.1);
    --accent: #c6613f;
    --accent-text: #fff;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font: 14px/1.5 var(--cds-font-sans); background: var(--cds-page-bg); color: var(--cds-text-primary); }
button, input, select { font-family: inherit; }
button { min-height: 32px; font-size: 13px; border-radius: var(--cds-radius); font-weight: 500; padding: 0 12px; }
button.secondary { border: 1px solid var(--cds-border); background: var(--cds-surface-2); color: var(--cds-text-primary); }
button.secondary:hover, button.link:hover { background: var(--cds-fill-ghost-hover); }
button:not(:disabled) { transition: background-color var(--cds-dur-snap) ease, box-shadow var(--cds-dur-snap) ease; }
button:focus-visible, input:focus-visible, select:focus-visible, .office-card:focus-visible { outline: 2px solid var(--cds-fill-accent); outline-offset: 2px; }
input[type="text"], input[type="search"], select { min-height: 34px; font-size: 13px; background: #fff; }
.card { border-radius: var(--cds-radius-card); box-shadow: none; }
.screen:has(> .office-shell) { padding: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; overflow: hidden; }
.screen:has(> .office-login-screen) { padding: 0; margin: 0; width: 100%; max-width: none; min-height: 100dvh; }
.screen:has(> .office-shell) .card { margin: 0; }
body:has(.office-shell) { overflow: hidden; }
.office-shell { display: grid; grid-template-columns: 224px minmax(0,1fr); grid-template-rows: 46px minmax(0,1fr); height: 100dvh; background: var(--cds-surface-1); }
.office-shell.with-file-preview { grid-template-columns: 224px minmax(0,1fr) clamp(340px,44vw,860px); }
.office-shell.with-file-preview .office-top { grid-area: 1 / 1 / 2 / 4; }
.office-shell.with-file-preview.sidebar-hidden { grid-template-columns: 0 minmax(0,1fr) clamp(340px,44vw,860px); }
.office-shell.with-file-preview.sidebar-hidden .office-main { grid-area: 2 / 2 / 3 / 3; }
.office-top { z-index: 10; grid-area: 1 / 1 / 2 / 3; height: 46px; display: grid; grid-template-columns: 224px minmax(180px,1fr) auto; align-items: center; background: var(--cds-surface-2); border-bottom: 1px solid var(--cds-border); }
.office-brand { display: flex; gap: 7px; align-items: center; height: 100%; min-width: 0; padding: 0 14px; color: var(--cds-text-primary); font-weight: 690; letter-spacing: -.025em; white-space: nowrap; }
.office-brand img { width: 20px; height: 20px; object-fit: contain; }
.office-brand span { font-size: 14px; }
.office-brand button { border: 0; padding: 0 5px 0 0; color: var(--cds-text-muted); background: transparent; height: 30px; min-height: 30px; width: 25px; }
.office-brand button:hover { color: var(--cds-text-primary); }
.office-top-search { display: flex; align-items: center; justify-self: center; gap: 7px; padding: 0 12px; width: min(440px,calc(100% - 24px)); height: 32px; background: var(--cds-surface-1); border: 1px solid var(--cds-border); border-radius: 9px; color: var(--cds-text-muted); }
.office-top-search:focus-within { background: #fff; border-color: var(--cds-border-strong); }
.office-top-search input { min-height: 28px; min-width: 0; width: 100%; padding: 0; background: transparent; border: 0; outline: none; color: var(--cds-text-primary); }
.office-top-search input:focus-visible { outline: 0; }
.office-top-tools { display: flex; align-items: center; gap: 3px; padding-right: 12px; }
.office-icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 31px; height: 31px; min-height: 31px; padding: 0; background: transparent; border: 0; color: var(--cds-text-secondary); }
.office-icon-button:hover { background: var(--cds-fill-ghost-hover); }
.office-icon { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.office-icon.folder { width: 24px; height: 24px; fill: #e17a55; stroke: #d57452; stroke-width: 1.2; }
.office-icon.file { width: 22px; height: 22px; color: #8b979e; }
.office-icon.soft { color: var(--cds-text-muted); }
.office-side { grid-area: 2 / 1 / 3 / 2; min-height: 0; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--cds-border); background: var(--cds-surface-0); }
.office-side-body { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; padding: 8px 9px; }
.office-side-action { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--cds-text-primary); font-size: 13px; font-weight: 500; text-align: left; justify-content: flex-start; }
.office-side-action:hover, .office-tree-btn:hover { background: var(--cds-fill-ghost-hover); }
.office-side-action .office-icon { color: var(--cds-clay); }
.office-side-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 9px 5px; font-size: 11px; color: var(--cds-text-muted); }
.office-side-heading .office-icon { width: 14px; height: 14px; }
.office-capacity { padding: 7px 9px 4px; }
.office-capacity-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--cds-text-primary); }
.office-dot { width: 6px; height: 6px; border-radius: 100%; background: var(--cds-clay); flex: none; }
.office-capacity-track { margin: 8px 0 4px; width: 100%; height: 4px; border-radius: 5px; background: var(--cds-alpha-2); overflow: hidden; }
.office-capacity-fill { height: 100%; border-radius: inherit; background: var(--cds-clay); }
.office-capacity-detail { font-size: 11px; color: var(--cds-text-muted); font-variant-numeric: tabular-nums; }
.office-tree { padding-top: 9px; overflow-x: hidden; }
.office-tree-line { display: flex; align-items: center; padding-right: 4px; border-radius: 6px; min-height: 28px; }
.office-tree-line.current, .office-tree-line:hover { background: var(--cds-fill-ghost-hover); }
.office-tree-toggle { width: 17px; height: 27px; min-height: 27px; padding: 0; border: 0; background: transparent; color: var(--cds-text-secondary); }
.office-tree-toggle .office-icon { width: 12px; height: 12px; }
.office-tree-btn { display: inline-flex; align-items: center; gap: 6px; width: 100%; min-width: 0; flex: 1; min-height: 28px; padding: 0 5px; border: 0; border-radius: 5px; background: transparent; text-align: left; color: var(--cds-text-primary); font-weight: 400; }
.office-tree-btn.active { font-weight: 600; color: var(--cds-text-primary); }
.office-tree-btn .office-icon { width: 15px; height: 15px; }
.office-year-row .office-tree-btn { font-weight: 600; }
.office-year-row .office-icon.year-folder { color: var(--cds-text-primary); fill: var(--cds-text-primary); }
.office-tree-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-side-foot { border-top: 1px solid var(--cds-border); padding: 9px 10px; }
.office-account { display: flex; align-items: center; width: 100%; gap: 9px; border: 0; background: transparent; border-radius: 8px; padding: 6px; color: var(--cds-text-primary); text-align: left; }
.office-account:hover { background: var(--cds-fill-ghost-hover); }
.office-avatar { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: #faf0e9; color: #ac4c2e; font-weight: 650; }
.office-account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.office-account-text small { font-size: 11px; color: var(--cds-text-muted); }
.office-main { grid-area: 2 / 2 / 3 / 3; overflow: auto; min-width: 0; background: var(--cds-surface-1); scrollbar-width: thin; }
.office-main-top { display: flex; align-items: center; gap: 9px; justify-content: space-between; padding: 9px 14px 8px; min-height: 44px; }
.office-breadcrumb { display: flex; align-items: center; flex: 1; min-width: 0; gap: 4px; overflow: auto; scrollbar-width: thin; white-space: nowrap; }
.office-breadcrumb button { background: transparent; border: 0; color: var(--cds-text-secondary); padding: 0 5px; min-height: 26px; flex: none; font-size: 13px; }
.office-breadcrumb button:last-child { color: var(--cds-text-primary); font-weight: 550; }
.office-breadcrumb button:hover { background: var(--cds-fill-ghost-hover); }
.office-main-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.office-main-actions button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.office-main-actions .office-icon { width: 15px; height: 15px; }
.office-main-actions .office-action { background: var(--cds-fill-brand); min-height: 32px; color: #fff; }
.office-main-actions .office-action:hover { background: var(--cds-fill-brand-hover); }
.office-main-actions .office-icon-button.selected { color: var(--cds-clay-text); background: var(--cds-fill-brand-subtle); }
.office-main-actions .office-icon-button { border: 1px solid var(--cds-border); width: 30px; height: 30px; }
.office-file-head { display: grid; grid-template-columns: minmax(200px,1fr) 120px 130px; gap: 10px; align-items: center; padding: 1px 16px 6px; border-bottom: 1px solid var(--cds-border); color: var(--cds-text-secondary); font-size: 11px; }
.office-file-head button { border: 0; background: transparent; min-height: 22px; text-align: left; padding: 0; color: inherit; font-size: 11px; }
.office-file-head button:hover { color: var(--cds-text-primary); }
.office-file-section { padding: 9px 12px 0; color: var(--cds-text-muted); font-size: 11px; }
.office-file-content { padding: 0 12px 28px; }
.office-items.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(178px,1fr)); align-content: start; gap: 11px; }
.office-card { display: flex; align-items: center; gap: 10px; min-height: 57px; min-width: 0; border: 1px solid var(--cds-border); border-radius: 11px; background: var(--cds-surface-2); padding: 9px 10px; }
.office-card:hover { border-color: var(--cds-border-strong); box-shadow: var(--cds-shadow-sm); }
.office-card.current-preview { background: var(--cds-fill-brand-subtle); border-color: var(--cds-border-strong); }
.office-card.selected { border-color: var(--cds-clay); background: var(--cds-fill-brand-subtle); }
.office-card .office-card-open { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; padding: 0; text-align: left; background: transparent; color: var(--cds-text-primary); border: 0; }
.office-card.selected .office-file-name::before { content: '✓ '; color: var(--cds-clay-emphasized); }
.office-card-open .office-file-icon { flex: none; }
.office-card-detail { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.office-card-detail .office-file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.office-card-detail .office-file-meta { font-size: 11px; color: var(--cds-text-muted); }
.office-card-menu { display: flex; flex: none; opacity: 0; }
.office-card:hover .office-card-menu, .office-card:focus-within .office-card-menu { opacity: 1; }
.office-items.list { display: flex; flex-direction: column; gap: 1px; }
.office-items.list .office-card { min-height: 44px; padding: 6px 9px; border: 0; border-bottom: 1px solid var(--cds-border); border-radius: 0; background: transparent; box-shadow: none; }
.office-items.list .office-card:hover { background: var(--cds-fill-ghost-hover); }
.office-items.list .office-card.current-preview { background: var(--cds-fill-brand-subtle); }
.office-items.list .office-card-detail { flex-direction: row; align-items: center; width: 100%; }
.office-items.list .office-card-detail .office-file-name { flex: 1; }
.office-items.list .office-card-detail .office-file-meta { width: 110px; text-align: right; }
.office-items.list .office-card-detail .office-date { width: 120px; text-align: right; }
.office-items.list .office-card .office-card-open { gap: 10px; }
.office-items.list .office-card-menu { opacity: 1; }
.office-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 280px; color: var(--cds-text-muted); gap: 9px; text-align: center; }
.office-empty .office-icon { width: 38px; height: 38px; opacity: .5; }
.office-empty strong { font-size: 13px; color: var(--cds-text-secondary); font-weight: 550; }
.office-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 12px; margin-top: auto; background: var(--cds-surface-1); border-top: 1px solid var(--cds-border); color: var(--cds-text-muted); font-size: 11px; }
.office-footer .office-icon { width: 13px; height: 13px; }
.office-progress { min-height: 20px; color: var(--cds-text-secondary); font-size: 12px; padding: 0 12px; }
.office-dropzone { position: relative; }
.office-dropzone.dragging::after { content: "松开以加密上传文件"; position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; font-size: 16px; font-weight: 600; background: rgba(251,243,239,.92); border: 2px dashed var(--cds-clay); pointer-events: none; }
.office-action-menu { position: fixed; z-index: 70; width: 148px; max-width: calc(100vw - 20px); padding: 5px; border: 1px solid var(--cds-border); border-radius: 9px; background: var(--cds-surface-popover); box-shadow: var(--cds-shadow-popover); }
.office-action-menu button { display: flex; gap: 8px; align-items: center; justify-content: flex-start; width: 100%; text-align: left; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--cds-text-primary); }
.office-action-menu button:hover { background: var(--cds-fill-ghost-hover); }
.office-action-menu button.danger { color: var(--cds-text-danger); }
.office-app-settings { max-width: 960px; padding: 20px 22px 44px; }
.office-app-settings h2 { font-size: 15px; font-weight: 650; }
.office-app-settings .card { padding: 17px; margin-bottom: 14px; }
.office-app-settings .zone { padding: 12px 0; }
.office-app-settings .actions { gap: 8px; }
.office-app-settings p { font-size: 13px; }
.office-app-settings button { min-height: 33px; }
.office-status { display: inline-flex; align-items: center; gap: 5px; color: var(--cds-text-muted); font-size: 11px; }
.office-status .office-icon { width: 14px; height: 14px; }
.office-mobile-shade { display: none; }
.office-shell.sidebar-hidden { grid-template-columns: 0 minmax(0,1fr); }
.office-shell.sidebar-hidden .office-top { grid-template-columns: 224px minmax(180px,1fr) auto; }
.office-shell.sidebar-hidden .office-side { visibility: hidden; }
.office-shell.sidebar-hidden .office-main { grid-area: 2 / 1 / 3 / 3; }
.office-login-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 40px 18px; background: var(--cds-surface-0); }
.office-login { width: min(100%,440px); padding: 28px; background: #fff; border: 1px solid var(--cds-border); border-radius: 14px; box-shadow: var(--cds-shadow-sm); }
.office-login-brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0 0 28px; }
.office-login-brand img { width: 24px; height: 24px; }
.office-login h1 { font-size: 21px; font-weight: 680; margin-bottom: 4px; }
.office-login .card { background: transparent; border: 0; padding: 10px 0; margin-top: 8px; }
.office-login button:not(.link) { width: 100%; margin-top: 8px; }
.office-login .actions { display: block; }
.office-login input[type="text"] { min-height: 38px; }
.office-login .code { font-size: 15px; line-height: 1.7; }
.office-login .muted { font-size: 13px; }
.office-login-footer { margin: 22px 0 0; font-size: 11px; color: var(--cds-text-muted); text-align: center; }
.office-login-footer .office-icon { vertical-align: -3px; width: 13px; }
.office-selected-tools { display: flex; align-items: center; gap: 7px; flex: none; }
.office-selected-count { color: var(--cds-text-secondary); font-size: 12px; white-space: nowrap; }
.office-selected-tools button { min-height: 30px; }
.toast { z-index: 100; box-shadow: var(--cds-shadow-popover); }
.preview { z-index: 80; }
@media (max-width: 900px) {
 .office-shell { grid-template-columns: 198px minmax(0,1fr); }
 .office-shell.with-file-preview { grid-template-columns: 198px minmax(0,1fr) clamp(340px,44vw,860px); }
 .office-shell.with-file-preview.sidebar-hidden { grid-template-columns: 0 minmax(0,1fr) clamp(340px,44vw,860px); }
 .office-top { grid-template-columns: 198px minmax(0,1fr) auto; }
 .office-items.grid { grid-template-columns: repeat(auto-fill,minmax(165px,1fr)); }
}
@media (max-width: 680px) {
 .office-shell, .office-shell.sidebar-hidden { grid-template-columns: minmax(0,1fr); }
 .office-top, .office-shell.sidebar-hidden .office-top { grid-template-columns: 150px minmax(0,1fr) 40px; }
 .office-brand { padding: 0 7px; }
 .office-brand span { font-size: 12px; }
 .office-top-search { width: calc(100% - 8px); }
 .office-top-search input { font-size: 12px; }
 .office-top-tools { padding-right: 5px; }
 .office-top-tools .office-icon-button:not(:last-child) { display: none; }
 .office-side { position: fixed; z-index: 45; left: 0; top: 46px; bottom: 0; width: 250px; box-shadow: var(--cds-shadow-md); transform: translateX(-110%); visibility: visible; transition: transform var(--cds-dur-base) ease; }
 .office-shell.sidebar-open .office-side { transform: translateX(0); }
 .office-shell.sidebar-open .office-mobile-shade { display: block; position: fixed; z-index: 44; inset: 46px 0 0; background: rgba(0,0,0,.24); }
 .office-main, .office-shell.sidebar-hidden .office-main { grid-area: 2 / 1 / 3 / 2; }
 .office-main-top { padding: 7px 9px; gap: 4px; flex-wrap: wrap; }
 .office-main-actions { width: 100%; justify-content: flex-end; }
 .office-file-head { grid-template-columns: 1fr auto auto; padding: 0 12px 6px; }
 .office-items.grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
 .office-card { min-height: 61px; padding: 8px; }
 .office-card .office-icon.folder { width: 19px; height: 19px; }
 .office-card-detail .office-file-name { font-size: 12px; }
 .office-card-menu { opacity: 1; }
 .office-app-settings { padding: 12px; }
 .office-items.list .office-card-detail .office-date { display: none; }
 .office-items.list .office-card-detail .office-file-meta { width: 75px; }
 .office-login { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
