* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font: 100%/1.5 Inter, system-ui, "Microsoft YaHei", sans-serif;
  --text: #18252c;
  --muted: #52636e;
  --line: #dbe5e9;
  --surface: #fff;
  --background: #f3f7f8;
  --accent: #086555;
  --accent-hover: #074c40;
  --danger: #a3272e;
}
body { margin: 0; background: var(--background); color: var(--text); }
[hidden] { display: none !important; }
.frame { width: min(1160px, calc(100% - 3rem)); margin-inline: auto; }
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: .65rem; align-items: center; font-weight: 750; }
.brand-mark {
  display: grid; place-items: center; width: 33px; height: 33px;
  border-radius: 10px; background: var(--accent); color: white; font-size: 1.35rem;
}
main { padding-block: 3rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.7rem, 4vw, 2.35rem); letter-spacing: -.035em; }
h2 { font-size: 1.3rem; }
label { display: block; font-size: .9rem; font-weight: 600; }
button, input, select { font: inherit; }
button, .row-action {
  touch-action: manipulation; min-height: 40px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text);
  padding: .45rem .8rem; cursor: pointer; font-size: .9rem; font-weight: 650;
}
button:hover, .row-action:hover { background: #eaf2f4; text-decoration: none; }
:focus-visible { outline: 2px solid #007a65; outline-offset: 3px; }
button:disabled { opacity: .6; cursor: wait; }
.primary { background: var(--accent); border-color: var(--accent); color: white; }
.primary:hover { background: var(--accent-hover); }
.quiet { border-color: transparent; background: transparent; }
.danger { color: var(--danger); }
.primary.danger { color: white; background: var(--danger); border-color: var(--danger); }
input:not([type=file]), select {
  width: 100%; padding: .65rem .75rem; border-radius: 8px; margin-top: .35rem;
  border: 1px solid #becdd3; background: var(--surface); color: var(--text);
}
.login-panel, dialog {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.75rem; width: min(100%, 420px);
  box-shadow: 0 15px 40px #183b4510;
}
.login-panel { margin: min(9vh, 5rem) auto 0; }
.login-panel form { margin-top: 1.6rem; }
.login-panel button { margin-top: 1rem; width: 100%; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 1.2rem; margin-bottom: 1.4rem; }
#breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .65rem; font-size: .9rem; color: var(--muted); }
.crumb { border: none; color: var(--accent); padding: 0; min-height: 32px; background: transparent; }
.crumb:hover { background: transparent; text-decoration: underline; }
.toolbar { display: flex; gap: .55rem; flex-wrap: wrap; }
.listing { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list-head, .entry {
  display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 10rem 16.25rem;
  align-items: center; gap: .8rem; padding: .65rem 1.1rem;
}
.list-head { font-size: .875rem; font-weight: 700; color: var(--muted); background: #f9fbfc; }
#entries { padding: 0; margin: 0; list-style: none; }
.entry { min-height: 60px; border-top: 1px solid var(--line); }
.entry-name { display: flex; align-items: center; min-width: 0; gap: .65rem; overflow-wrap: anywhere; }
.entry-name button { text-align: left; overflow-wrap: anywhere; padding: .2rem 0; border: 0; background: transparent; color: var(--accent); }
.entry-name button:hover { text-decoration: underline; }
.file-mark {
  flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 8px; color: var(--accent); background: #e7f3f0; font-size: .75rem; font-weight: 750;
}
.folder-mark { background: #fff2d9; color: #6d4a11; }
.entry-meta { color: var(--muted); font-size: .875rem; }
.entry-actions { display: flex; flex-wrap: wrap; gap: .25rem; }
.entry-actions button, .entry-actions a { border-color: transparent; min-height: 36px; padding: .35rem .45rem; }
.empty { text-align: center; color: var(--muted); margin: 0; border-top: 1px solid var(--line); padding: 3rem 1rem; }
.notice, .upload-status { padding: .65rem 1rem; margin: 0 0 1rem; border-radius: 8px; background: #e1f1ed; overflow-wrap: anywhere; }
.error { color: var(--danger); }
.notice.error { background: #fce9eb; }
progress { width: 100%; accent-color: var(--accent); height: .65rem; }
dialog { max-width: calc(100% - 2rem); color: var(--text); }
dialog::backdrop { background: #162e3fb0; }
dialog h2 { margin-bottom: 1rem; }
dialog p { overflow-wrap: anywhere; }
.dialog-actions { margin-top: 1.4rem; justify-content: end; }
@media (max-width: 780px) {
  .frame { width: calc(100% - 2rem); }
  main { padding-block: 1.75rem; }
  .heading { align-items: start; flex-direction: column; }
  .list-head { display: none; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .5rem; padding: .65rem .75rem; }
  .entry:first-child { border-top: 0; }
  .entry-time { display: none; }
  .entry-actions { grid-column: 1 / -1; padding-left: 2rem; }
}
