:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --surface: #fff;
  --ink: #221e35;
  --muted: #625e76;
  --line: #e6e3ef;
  --accent: #5636c5;
  --accent-hover: #4527a8;
  --tint: #f0ebff;
  --danger: #a52243;
  font-family: "Inter", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { width: min(100% - 48px, 1080px); margin-inline: auto; }
.topbar { background: var(--surface); box-shadow: inset 0 -1px var(--line); }
.topbar-inner, .page-heading, .upload, .upload-controls, .upload-intro { display: flex; align-items: center; }
.topbar-inner { justify-content: space-between; min-height: 42px; }
.brand-mark, .upload-mark, .empty-mark { display: inline-grid; place-items: center; border-radius: 12px; }
.brand-mark { width: 24px; height: 24px; border-radius: 8px; background: var(--accent); }
.folder-icon, .file-icon { display: inline-block; position: relative; flex: none; color: var(--accent); }
.folder-icon { width: 19px; height: 13px; border-radius: 2px; background: currentColor; margin-top: 3px; }
.folder-icon::before { content: ""; position: absolute; width: 8px; height: 4px; left: 0; top: -3px; background: currentColor; border-radius: 2px 2px 0 0; }
.brand-mark .folder-icon { width: 14px; height: 10px; color: white; }
.brand-mark .folder-icon::before { width: 6px; }
.file-icon { width: 14px; height: 17px; border: 1.5px solid #756999; border-radius: 3px; margin-inline: 2.5px; }
.file-icon::after { content: ""; position: absolute; inset: 5px 3px auto; height: 1px; background: #756999; box-shadow: 0 3px #756999; }

.workspace { padding-block: 42px 56px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .88rem; color: var(--muted); margin-bottom: 14px; overflow-wrap: anywhere; }
.separator { color: #a09ab0; }
.page-heading { justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-bottom: 26px; }
.page-heading h1 { font-size: 18px; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.24; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { font-size: 1.04rem; line-height: 1.4; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-size: .88rem; font-weight: 680; text-decoration: none; white-space: nowrap; }
.page-heading .button, .upload-controls .button { font-size: 12px; }
.button:hover { text-decoration: none; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.secondary:hover { border-color: #bcb0e6; background: #fcfaff; }
.destructive { color: white; background: var(--danger); }
.destructive:hover { background: #831533; }
.plain { white-space: nowrap; border: 0; background: transparent; color: var(--muted); padding: 5px; border-radius: 5px; font-size: .84rem; }
.plain:hover { background: var(--tint); color: var(--accent); }
.danger { color: var(--danger); }
.danger:hover { color: var(--danger); background: #fcebf0; }

.notice { padding: 12px 15px; margin-bottom: 16px; border: 1px solid #c1e5d1; border-radius: 10px; background: #edf9f2; color: #195c36; }
.upload { flex-wrap: wrap; justify-content: space-between; gap: 17px; padding: 19px 22px; margin-bottom: 22px; border: 1px solid #ded5fb; border-radius: 14px; background: #fbf9ff; }
.upload-intro, .upload-controls { gap: 13px; }
.upload-intro h2 { font-size: 14px; }
.upload-intro p { color: var(--muted); font-size: 11.18px; margin-top: 4px; }
.upload-mark { flex: none; width: 42px; height: 42px; color: var(--accent); background: var(--tint); font-size: 1.5rem; font-weight: 680; }
.upload-controls { max-width: 100%; }
.upload input { min-width: 0; max-width: 260px; color: var(--muted); font-size: 11.45px; }
.upload input::file-selector-button { margin-right: 9px; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--ink); cursor: pointer; }

.listing { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 5px #2c185904; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 13px 18px; }
th { background: #fbfaff; color: var(--muted); white-space: nowrap; font-size: .79rem; font-weight: 650; }
td { border-top: 1px solid var(--line); }
tr:hover td { background: #fcfbff; }
.item { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 580; min-width: 132px; overflow-wrap: anywhere; }
.metadata { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.operations { text-align: right; }
.row-actions { display: flex; justify-content: end; gap: 7px; }
.empty { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 225px; color: var(--muted); }
.empty-mark { width: 50px; height: 50px; background: var(--tint); }

dialog, .card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 26px; color: var(--ink); box-shadow: 0 16px 50px #39296a12; }
dialog { width: min(400px, 100% - 28px); }
.post-dialog { width: min(620px, 100% - 28px); }
.post-dialog textarea { display: block; resize: vertical; font: .85rem/1.5 ui-monospace, Consolas, monospace; }
.copy-status { margin-top: 8px; font-size: .85rem; }
.copy-status:empty { display: none; }
dialog::backdrop { background: #21163865; }
dialog h2 { margin-bottom: 16px; }
dialog p { overflow-wrap: anywhere; color: var(--muted); }
.dialog-actions { display: flex; gap: 9px; justify-content: end; margin-top: 22px; }
label { display: block; margin-bottom: 6px; font-weight: 680; font-size: .87rem; }
input:not([type="file"], [type="hidden"]), .post-dialog textarea { width: 100%; padding: 10px 11px; border: 1px solid #d9d4e8; border-radius: 8px; color: var(--ink); background: var(--surface); }
.centered { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 12%, #ede8fc, var(--bg) 68%); }
.card { width: min(100%, 430px); padding: clamp(22px, 6vw, 36px); }
.login form label:not(:first-child) { margin-top: 14px; }
.login form button { margin-top: 20px; width: 100%; }
.login-error { font-size: .85rem; padding: 10px 12px; margin-bottom: 16px; color: var(--danger); background: #fceef2; border-radius: 8px; }
.captcha { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: .85rem; }
.captcha img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.error-card p { margin-block: 13px 19px; color: var(--muted); }

@media (max-width: 590px) {
  .container { width: calc(100% - 28px); }
  .workspace { padding-top: 26px; }
  .upload { padding: 15px; }
  .upload-controls { flex: 1 1 100%; justify-content: space-between; }
  th, td { padding-inline: 11px; }
}
