:root {
  color-scheme: light;
  --paper: #fff;
  --canvas: #f3f6f3;
  --ink: #14241b;
  --muted: #56635b;
  --green: #125332;
  --green-dark: #0b4025;
  --green-soft: #dce9de;
  --line: #d9e1da;
  --danger: #952c29;
  --radius: 12px;
  font-family: 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 300px; margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: var(--green); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #318758; outline-offset: 3px; }
button > span[data-icon], .brand-icon, .search > span, .breadcrumb-icon, .empty-icon { display: inline-grid; flex: none; place-items: center; }
.icon { display: block; width: 21px; height: 21px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 24px; font-weight: 750; white-space: nowrap; letter-spacing: -.03em; }
.brand-icon { width: 43px; height: 43px; color: white; background: var(--green); border-radius: 11px; }
.brand-icon .icon { width: 26px; height: 26px; }
.button { display: inline-flex; min-height: 45px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 9px; padding: 0 16px; color: var(--ink); background: transparent; font-weight: 650; white-space: nowrap; text-decoration: none; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); }
.button.outline { color: var(--green); border-color: #739380; background: var(--paper); }
.button.outline:hover, .button.subtle:hover { background: #e9f0ea; }
.button.danger { background: var(--danger); color: white; }
.button.danger:hover { background: #76211e; }
.icon-button { display: inline-grid; place-items: center; width: 37px; height: 36px; padding: 0; background: transparent; border: 0; border-radius: 7px; color: var(--muted); }
.icon-button:hover, .icon-button[aria-expanded='true'] { background: #eaf1eb; color: var(--ink); }

.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 418px); padding: 38px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: 0 22px 64px #203f2910; }
.login-card .brand { margin-bottom: 30px; }
.login-card h1, .heading h1 { margin: 0; font-weight: 750; letter-spacing: -.025em; }
.login-card h1 { font-size: 29px; }
.login-card p { margin: 9px 0 24px; color: var(--muted); line-height: 1.55; }
.login-card form { display: grid; gap: 16px; }
.login-card form .button { margin-top: 4px; }
.login-card > a { display: inline-block; margin-top: 19px; text-underline-offset: 3px; }
form label { display: grid; gap: 7px; font-weight: 650; }
form input, form select { min-width: 0; width: 100%; height: 43px; border: 1px solid #bdc9c0; border-radius: 8px; padding: 0 11px; color: var(--ink); font-weight: 400; background: white; }
.error, .login-card .error { color: var(--danger); margin: 0; line-height: 1.5; }

.workspace { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); padding: 30px 13px 20px; }
.sidebar .brand { margin: 0 16px 36px; }
.navigation { display: grid; gap: 5px; }
.nav-item, .account-button { display: flex; align-items: center; gap: 13px; min-height: 49px; width: 100%; padding: 0 17px; text-align: left; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-weight: 625; }
.nav-item:hover, .account-button:hover { background: #eef4ee; }
.nav-item[aria-current='page'] { background: var(--green-soft); color: #143d26; }
.nav-item .icon { width: 23px; height: 23px; }
.nav-item[aria-current='page'] .icon, .logout .icon { color: var(--green); }
.account { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.account-button { margin-bottom: 3px; padding-left: 9px; }
.account-button #account-name { min-width: 0; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.account-button .icon { width: 16px; height: 16px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: #d7e8d9; color: var(--green); font-size: 17px; font-weight: 750; }
.logout { font-weight: 500; }
.main { min-width: 0; }
.topbar { display: flex; height: 70px; align-items: center; justify-content: space-between; gap: 22px; padding: 0 30px 0 34px; border-bottom: 1px solid var(--line); }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 9px; font-weight: 650; overflow-x: auto; scrollbar-width: thin; }
.breadcrumbs .icon { width: 17px; height: 17px; color: var(--muted); }
.breadcrumb-icon .icon { width: 23px; height: 23px; color: var(--green); }
.breadcrumbs button { font: inherit; white-space: nowrap; color: var(--green); padding: 4px 2px; border: 0; background: transparent; }
.breadcrumbs button:hover { text-decoration: underline; }
.breadcrumbs span { white-space: nowrap; }
.search { display: flex; width: min(33%, 335px); min-width: 211px; height: 40px; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid #aab8ad; border-radius: 8px; background: var(--paper); color: var(--muted); }
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px #36a36128; }
.search input { border: none; padding: 0; min-width: 0; width: 100%; background: transparent; outline: 0; color: var(--ink); }
.search .icon { width: 18px; height: 18px; }
.content { padding: 38px 30px 36px 34px; }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.heading h1 { font-size: clamp(27px, 3vw, 39px); line-height: 1.13; overflow-wrap: anywhere; }
.heading p { margin: 12px 0 0; color: var(--muted); line-height: 1.5; }
.actions { display: flex; flex: none; gap: 12px; align-items: center; margin-top: 5px; }
.table-panel { overflow: hidden; border: 1px solid #d4dfd6; border-radius: var(--radius); background: var(--paper); }
table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
th, td { padding: 0 15px; }
th:first-child, td:first-child { padding-left: 25px; width: 48%; }
th:nth-child(2), td:nth-child(2) { width: 16%; }
th:nth-child(3), td:nth-child(3) { width: 24%; }
th:last-child, td:last-child { width: 12%; text-align: center; padding-right: 15px; }
th { height: 50px; background: #e4ece5; font-weight: 700; white-space: nowrap; }
td { height: 54px; border-top: 1px solid #e3e8e3; color: var(--muted); font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f8fbf8; }
.file-cell { display: flex; min-width: 0; align-items: center; gap: 12px; }
.file-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 7px; background: #e8f2e9; color: #247248; }
.file-icon.folder { background: #f8efda; color: #966617; }
.file-icon .icon { width: 20px; height: 20px; }
.file-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); }
.file-link { border: 0; padding: 3px 0; background: transparent; font: inherit; font-weight: 610; text-align: left; text-decoration: none; }
.file-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.count { color: var(--muted); margin: 15px 1px 0; font-size: 14px; }
.empty { display: grid; justify-items: center; padding: 68px 20px 70px; text-align: center; }
.empty-icon { border-radius: 13px; background: #eaf2eb; color: var(--green); width: 47px; height: 47px; }
.empty h2 { font-size: 18px; margin: 14px 0 4px; }
.empty p { margin: 0; color: var(--muted); line-height: 1.55; }

dialog { width: min(calc(100% - 32px), 450px); border: 1px solid var(--line); border-radius: 15px; padding: 24px; color: var(--ink); box-shadow: 0 20px 60px #18362428; }
dialog::backdrop { background: #11271d61; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.dialog-head h2 { margin: 0; font-size: 22px; }
#dialog-content { display: grid; gap: 13px; }
#dialog-content p { margin: 0; color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
#dialog-error { margin-top: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.menu { position: fixed; z-index: 4; min-width: 135px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 8px 24px #14241b1d; transform: translate(var(--menu-x, 0px), var(--menu-y, 0px)); inset: 0 auto auto 0; }
.menu button, .menu a { display: block; width: 100%; padding: 8px 10px; text-align: left; background: transparent; border: 0; border-radius: 6px; text-decoration: none; color: var(--ink); }
.menu button:hover, .menu a:hover { background: #edf3ee; }
.menu .destructive { color: var(--danger); }
.notice { position: fixed; right: 24px; bottom: 22px; z-index: 6; max-width: min(410px, calc(100vw - 48px)); padding: 12px 17px; border-radius: 9px; background: #183f29; color: white; box-shadow: 0 8px 22px #183f2925; overflow-wrap: anywhere; }
.notice.failed { background: var(--danger); }
.transfer { padding: 12px 15px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.transfer p { margin: 2px 0 8px; overflow-wrap: anywhere; }
.transfer progress { width: 100%; accent-color: var(--green); }
.transfer li { color: var(--danger); overflow-wrap: anywhere; }
.transfer .button { min-height: 36px; }

@media (min-width: 1100px) {
  .workspace { grid-template-columns: clamp(246px, 18vw, 266px) minmax(0, 1fr); }
  .sidebar .brand { margin-bottom: 44px; }
  .sidebar .nav-item { min-height: 53px; font-size: 17px; }
  .topbar { height: 76px; font-size: 17px; }
  .search { width: min(35%, 361px); }
  .content { padding-top: 47px; padding-left: 36px; }
  .heading { margin-bottom: 36px; }
  .heading p { font-size: 17px; }
  .heading .button { min-height: 51px; padding: 0 20px; font-size: 17px; }
  .heading .actions { margin-top: 11px; }
  th { height: 56px; font-size: 17px; }
  td { height: 55px; font-size: 17px; }
  th:first-child, td:first-child { padding-left: 32px; }
  .file-cell { gap: 16px; }
}

@media (max-width: 850px) {
  .workspace { grid-template-columns: 185px minmax(0, 1fr); }
  .sidebar .brand { font-size: 19px; margin-left: 3px; }
  .sidebar .brand-icon { width: 35px; height: 35px; }
  .content, .topbar { padding-left: 21px; padding-right: 21px; }
  .heading { flex-wrap: wrap; }
  th:first-child, td:first-child { padding-left: 14px; width: 44%; }
  th:nth-child(3), td:nth-child(3) { width: 27%; }
  th:last-child, td:last-child { width: 13%; padding: 0 3px; }
  th, td { padding: 0 7px; }
}

@media (max-width: 590px) {
  .workspace { display: block; }
  .sidebar { position: relative; height: auto; padding: 12px 14px 7px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .sidebar .brand { margin: 0; }
  .account { grid-column: 2; grid-row: 1; border: 0; padding: 0; margin: 0; display: flex; align-items: center; }
  .account-button { width: auto; padding: 0 5px; margin: 0; }
  .account-button #account-name, .account-button [data-icon], .logout > span:last-child { display: none; }
  .avatar { width: 31px; height: 31px; }
  .logout { width: auto; padding: 0 5px; }
  .navigation { grid-column: 1 / -1; display: flex; overflow: auto; }
  .nav-item { min-height: 39px; padding: 0 9px; font-size: 13px; gap: 5px; white-space: nowrap; width: auto; }
  .nav-item .icon { width: 18px; height: 18px; }
  .topbar { display: grid; justify-content: stretch; height: auto; gap: 9px; padding: 10px 14px; }
  .search { width: 100%; min-width: 0; height: 37px; }
  .content { padding: 23px 12px 28px; }
  .heading { gap: 10px; margin-bottom: 17px; }
  .heading p { margin-top: 6px; }
  .actions { gap: 7px; }
  .actions .button { min-height: 40px; padding: 0 9px; }
  .actions .icon { width: 18px; height: 18px; }
  th:first-child, td:first-child { width: 64%; padding-left: 8px; }
  th:nth-child(2), td:nth-child(2) { width: 21%; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  th:last-child, td:last-child { width: 15%; }
  th, td { font-size: 13px; }
  .file-cell { gap: 6px; }
  .file-icon { width: 27px; height: 27px; }
  .file-icon .icon { width: 17px; height: 17px; }
  .login-card { padding: 27px; }
}
