:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #172a30;
  background: #edf1ed;
  --paper: #fafcf8;
  --panel: #f2f5f0;
  --line: #243f3926;
  --muted: #4f635f;
  --green: #164941;
  --accent: #e8ac69;
  --error: #a12b26;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid #086e60; outline-offset: 3px; }
h1, h2, p { margin: 0; }
button { color: inherit; }
.topbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 72px; padding: 12px clamp(16px, 4vw, 56px); background: #18352f; color: #f4f6ee; }
.brand { color: inherit; display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand strong { display: block; font-size: 14px; letter-spacing: .13em; }
.brand small { display: block; margin-top: 2px; font-size: 12px; color: #ccdcd2; }
.mark { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border: 1px solid #e8ac6980; color: var(--accent); border-radius: 9px; font: 700 21px Georgia, serif; }
.identity { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.identity button { border-color: #ffffff50; }
.identity .quiet { white-space: nowrap; }
.password-fields { display: grid; gap: 10px; }
.password-dialog { box-sizing: border-box; width: min(440px, calc(100% - 26px)); max-height: calc(100dvh - 26px); padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: inherit; }
.password-dialog::backdrop { background: #172a3075; }
.password-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.password-dialog-heading h2 { margin: 0; font-size: 18px; }
#password-status[data-success] { color: var(--green); }
main { padding: clamp(16px, 3vw, 38px); max-width: 1560px; margin: auto; }
.login { min-height: min(580px, calc(100svh - 145px)); display: grid; grid-template-columns: 1fr minmax(260px, 350px); gap: 30px; align-items: center; padding: clamp(25px, 7vw, 95px); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.intro .company { font-size: 12px; font-weight: 850; letter-spacing: .16em; color: var(--green); }
.intro h1 { margin: 14px 0 15px; font-size: clamp(32px, 4.5vw, 58px); letter-spacing: -.05em; line-height: 1.14; }
.intro p:last-child { color: var(--muted); line-height: 1.65; }
.login form { display: grid; gap: 10px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.login h2 { margin-bottom: 8px; font-size: 21px; }
.login label { margin-top: 4px; font-size: 14px; font-weight: 650; }
input, select { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #aabbb2; background: var(--paper); color: inherit; border-radius: 7px; }
.primary, .quiet { border: 1px solid var(--line); border-radius: 7px; min-height: 40px; padding: 7px 13px; font-weight: 650; background: transparent; }
.primary { background: var(--green); color: #f9fcf6; border-color: var(--green); margin-top: 8px; }
.primary:hover { background: #0a3c32; }
.quiet:hover { background: #427a6220; }
.status { font-size: 13px; color: var(--error); min-height: 1.2em; }
.library { display: grid; min-height: calc(100svh - 160px); grid-template-columns: clamp(340px, 29vw, 450px) minmax(0, 1fr); border-radius: 13px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.navigation { min-width: 0; border-right: 1px solid var(--line); background: var(--panel); }
.nav-head { padding: 20px 14px 13px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.nav-top, #team-count { grid-column: 1 / -1; }
.nav-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.nav-top h1 { font-size: 18px; white-space: nowrap; }
.directory-back { display: inline-flex; justify-self: start; align-items: center; gap: 6px; min-height: 44px; padding: 7px 11px; color: var(--green); background: var(--paper); white-space: nowrap; font-size: 13px; }
.breadcrumbs { color: var(--muted); font-size: 13px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.breadcrumbs li + li::before { content: "›" / ""; color: var(--muted); }
.breadcrumbs button, .breadcrumbs li > span { padding: 4px 0; text-align: left; overflow-wrap: anywhere; }
.breadcrumbs button { min-height: 34px; border: 0; background: transparent; color: var(--green); }
.breadcrumbs button:hover { text-decoration: underline; }
.breadcrumbs [aria-current] { font-weight: 700; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.team-list { max-height: 72vh; overflow: auto; padding: 0 10px 13px; }
.folder-entry { width: 100%; display: grid; grid-template-columns: 37px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 55px; padding: 9px; text-align: left; border: 1px solid transparent; border-radius: 6px; background: transparent; }
.folder-entry[aria-current="location"] { border-color: #98b6a8; background: #dcebe1; }
.folder-icon { position: relative; justify-self: center; width: 25px; height: 17px; margin-top: 4px; border: 1px solid #af7232; border-radius: 2px 3px 3px; background: #f4d5a7; }
.folder-icon::before { content: ""; position: absolute; bottom: 100%; left: -1px; width: 13px; height: 5px; border: 1px solid #af7232; border-bottom: 0; border-radius: 3px 3px 0 0; background: #f4d5a7; }
.folder-arrow { color: var(--muted); font-size: 21px; line-height: 1; }
#team-code, #preview-title { overflow-wrap: anywhere; }
.row-label { min-width: 0; }
.row-label strong, .row-label .meta { display: block; overflow-wrap: anywhere; }
.folder-entry strong { font-size: 14px; font-weight: 700; line-height: 1.4; }
.team-list strong { font-size: 13px; }
.workspace { min-width: 0; }
.empty { padding: 22px; color: var(--muted); }
.team-summary { padding: 22px clamp(16px, 3vw, 32px) 16px; border-bottom: 1px solid var(--line); background: #eef4ec; }
.team-summary h2 { font-size: clamp(21px, 3vw, 31px); letter-spacing: -.027em; margin: 5px 0; }
.team-summary p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.team-summary .owner { margin-top: 5px; color: var(--green); }
.tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); padding-inline: clamp(16px, 3vw, 32px); }
.tabs button { padding: 9px 4px 7px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); min-height: 44px; font-weight: 700; }
.tabs button[aria-pressed="true"] { border-bottom-color: var(--green); color: var(--green); }
.workspace-tools, #files-view, #route-view { padding-inline: clamp(16px, 3vw, 32px); }
.workspace-tools { display: grid; gap: 10px; padding-block: 16px 8px; }
.file-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 145px); gap: 10px; max-width: 600px; }
.directory-step { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
#files-view, #route-view { padding-bottom: 17px; }
.file, .file-list .folder-entry { width: 100%; display: grid; grid-template-columns: 45px minmax(0, 1fr) 80px; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 9px 5px; text-align: left; min-height: 55px; background: transparent; }
.folder-entry:hover, .file:hover { background: #e4ede5; }
.folder-entry[aria-current="location"]:hover { background: #dcebe1; }
.file[aria-current="true"], .file[aria-current="true"]:hover { background: #dcebe1; box-shadow: inset 3px 0 #4f806e; }
.file-list .folder-entry .folder-arrow { justify-self: end; }
.format { border-radius: 6px; display: grid; place-items: center; min-height: 36px; background: #e4ece5; color: var(--green); font-size: 10px; font-weight: 800; }
.file-name { display: block; font-size: 14px; font-weight: 650; }
.file > .meta { text-align: right; }
.page-actions { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; padding: 12px 5px; }
.day { display: grid; grid-template-columns: 108px 1fr; gap: 12px; padding-block: 11px; border-bottom: 1px solid var(--line); line-height: 1.55; }
.day time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.library.preview-open { grid-template-columns: minmax(0, 1fr); }
.preview-open .navigation { display: none; }
.preview-open .document-layout { height: max(420px, calc(100dvh - 132px)); display: grid; grid-template-columns: minmax(288px, 4fr) minmax(0, 6fr); }
.preview-open .document-browser { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.preview-pane { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #e1e3db; border-left: 1px solid var(--line); }
.preview-head { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 13px clamp(12px, 2.1vw, 22px); background: var(--paper); border-bottom: 1px solid var(--line); }
.preview-label { min-width: 0; }
.preview-head h2 { font-size: 15px; line-height: 1.4; }
.preview-head .meta { margin-top: 4px; }
.preview-head .quiet { min-height: 44px; padding-inline: 10px; white-space: nowrap; }
.preview-content { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: clamp(10px, 1.9vw, 24px); }
.preview-content:focus-visible { outline-offset: -3px; }
.preview-content img { display: block; max-width: min(100%, 880px); height: auto; margin-inline: auto; background: #fefdfb; box-shadow: 0 2px 10px #172a3030; }
.preview-content img + img { margin-top: clamp(10px, 1.8vw, 22px); }
.preview-content pre { max-width: 880px; margin: 0 auto; padding: clamp(14px, 3vw, 32px); background: #fefdfb; box-shadow: 0 2px 10px #172a3020; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 14px; line-height: 1.7; }
.preview-notice { max-width: 420px; margin: 8px auto; padding: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--muted); font-size: 14px; }
.preview-progress { flex: 0 0 100%; height: 6px; overflow: hidden; border-radius: 999px; background: #dce9e1; }
.preview-progress::before { content: ""; display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--green); animation: preview-progress-slide 1.6s ease-in-out infinite; }
@keyframes preview-progress-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(288%); }
}
@media (prefers-reduced-motion: reduce) {
  .preview-progress::before { width: 100%; animation: none; background: repeating-linear-gradient(135deg, #6d9988 0 6px, #dce9e1 6px 13px); }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 860px) {
  .library { grid-template-columns: 1fr; }
  .navigation { border-right: 0; }
  .library:not(.team-open) .workspace, .library.team-open .navigation { display: none; }
  .team-loading #team-detail { display: none; }
  .team-list { max-height: none; }
  .file > .meta { display: none; }
  .file, .file-list .folder-entry { grid-template-columns: 45px minmax(0, 1fr) 12px; }
  .breadcrumbs button { min-height: 42px; }
  .file-tools { grid-template-columns: minmax(0, 1fr) minmax(90px, 110px); }
  .preview-open .document-layout { height: max(380px, calc(100dvh - 106px)); grid-template-columns: minmax(0, 1fr); }
  .preview-open .document-browser { display: none; }
  .preview-pane { border-left: 0; }
}
@media (max-width: 700px) {
  .login { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .identity { gap: 5px; }
  .identity #account-name { display: none; }
  .identity .quiet { padding-inline: 7px; }
  .team-list { padding-inline: 7px; }
  .team-list .folder-entry { grid-template-columns: 28px minmax(0, 1fr) 9px; gap: 8px; padding-inline: 6px; }
  .preview-head { grid-template-columns: minmax(0, 1fr) auto; }
  .preview-head .format { display: none; }
}
