:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --background: #f3f7ff;
  --surface: #fff;
  --text: #182b4c;
  --muted: #4f6180;
  --brand: #1654d6;
  --brand-strong: #1147bd;
  --border: #d9e3f4;
  --tint: #edf4ff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; background: var(--background); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .56; cursor: default; }
:focus-visible { outline: 3px solid #2b70ef; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ul { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: calc(100% - 32px); max-width: 900px; margin-inline: auto; }
main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body:not(.library-open) main { display: grid; align-items: center; min-height: 100vh; min-height: 100dvh; padding-block: 24px; }
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand, .login-identity { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; }
.brand { font-size: .96rem; }
.brand-mark { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: white; font-size: 1.15rem; font-weight: 850; }
.account { position: relative; display: flex; align-items: center; gap: 8px; }
.role-label { font-size: .78rem; font-weight: 650; color: var(--muted); }
.menu-toggle { width: 44px; color: var(--brand); border-color: var(--border) !important; background: white; }
.menu-toggle span { width: 17px; height: 2px; background: currentColor; border-radius: 2px; box-shadow: 0 -5px currentColor, 0 5px currentColor; }
.account-menu { position: absolute; z-index: 2; top: calc(100% + 5px); right: 0; padding: 4px; width: 148px; box-shadow: 0 7px 24px #1f4a8725; }
.button.menu-item { display: flex; justify-content: flex-start; width: 100%; border-radius: 8px; background: white; color: var(--text); }
.button.menu-item:hover { background: var(--tint); }
.login-panel { width: min(100%, 348px); margin-inline: auto; padding: 0 1px; }
.login-identity { margin-bottom: 20px; font-size: 1.03rem; }
.login-identity .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 1.35rem; }
.login-panel h1 { font-size: clamp(1.78rem, 7vw, 2.2rem); line-height: 1.19; }
.login-intro { margin-top: 7px; color: var(--muted); font-size: .95rem; line-height: 1.55; }
#login-form { margin-top: 23px; }
label { display: block; font-size: .91rem; font-weight: 700; }
input { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; color: var(--text); background: var(--surface); border: 1px solid #b9cae6; border-radius: 10px; font-size: 1rem; }
input::placeholder { color: #607391; opacity: 1; }
label input, .password-field { margin-top: 7px; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.password-field input { min-height: 51px; border-color: #8aa8dd; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 10px; font-size: .92rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.primary { background: var(--brand); color: white; }
.primary:hover { background: var(--brand-strong); }
.outline { border-color: #c5d5ee; background: var(--surface); color: var(--brand-strong); }
.outline:hover, .text:hover { background: var(--tint); }
.text { background: transparent; color: var(--brand-strong); }
.wide { width: 100%; min-height: 49px; margin-top: 14px; }
.mode { display: flex; margin: 8px auto 0; }
.library { padding-top: 13px; }
.hero { padding: 17px 15px; border-radius: 14px; background: var(--brand); color: white; }
.hero h1 { font-size: 1.49rem; line-height: 1.25; letter-spacing: -.025em; }
.hero p { margin-top: 5px; color: #e6efff; font-size: .86rem; line-height: 1.48; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 7px; margin-top: 12px; }
.search-button { width: 48px; padding: 0; }
.search-icon { position: relative; width: 15px; height: 15px; margin-right: 3px; border: 2px solid currentColor; border-radius: 50%; }
.search-icon::after { content: ''; position: absolute; right: -6px; bottom: -3px; width: 7px; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.categories { margin: 18px 0; }
h2 { font-size: 1.11rem; line-height: 1.3; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.category-card { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 46px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: .87rem; font-weight: 690; text-align: left; }
.category-card[aria-pressed="true"] { border-color: #769de5; color: var(--brand-strong); background: #e8f1ff; }
.category-card span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder { position: relative; flex: none; width: 18px; height: 13px; margin-top: 2px; border-radius: 2px; border: 1.5px solid var(--brand); background: #e3eeff; }
.folder::before { content: ''; position: absolute; top: -5px; left: -1.5px; width: 8px; height: 5px; border: 1.5px solid var(--brand); border-bottom: 0; border-radius: 2px 2px 0 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title p { margin-top: 3px; color: var(--muted); font-size: .83rem; }
.panel { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.files { display: grid; gap: 7px; padding: 0; margin-top: 8px; list-style: none; }
.file { display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 8px; }
.file-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 8px; color: var(--brand-strong); background: var(--tint); font-size: .66rem; font-weight: 820; }
.file-description { min-width: 0; }
.file-name { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .9rem; line-height: 1.32; font-weight: 750; }
.file-meta { display: flex; flex-wrap: wrap; gap: 2px 7px; margin-top: 3px; color: var(--muted); font-size: .75rem; line-height: 1.3; }
.file-meta span { overflow-wrap: anywhere; }
.download { flex: none; min-width: 61px; padding-inline: 6px; }
.file-actions { grid-column: 2 / -1; display: flex; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--border); padding-top: 6px; }
.danger { color: #a72b35; }
.empty { padding: 21px 12px; margin-top: 8px; text-align: center; }
.empty p { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.message { padding: 8px 10px; margin-top: 8px; background: #fff1ec; border-radius: 8px; color: #8d3322; font-size: .87rem; line-height: 1.45; overflow-wrap: anywhere; }
.message.success { color: #22503c; background: #e7f5ec; }
.pages { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; }
dialog { width: min(calc(100% - 24px), 410px); max-width: none; max-height: calc(100dvh - 24px); overflow: auto; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #10235080; }
.fields { display: grid; gap: 11px; margin-top: 8px; }
input[type="file"] { padding: 6px; max-width: 100%; }
input::file-selector-button { min-height: 35px; padding-inline: 8px; margin-right: 6px; border: 0; border-radius: 7px; background: var(--tint); color: var(--brand-strong); font-weight: 700; }
progress { width: 100%; margin-top: 9px; accent-color: var(--brand); }
@media (min-width: 700px) {
  .top-inner { min-height: 66px; }
  .library { padding-top: 23px; }
  .hero { padding: 23px 24px; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: .94rem; }
  .search-form { margin-top: 14px; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-card { padding-inline: 12px; }
  .file { grid-template-columns: 40px minmax(0, 1fr) auto auto; padding: 9px 11px; }
  .file-actions { grid-column: auto; border: 0; padding: 0; }
  .download { min-width: 72px; }
}
