:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --text: #172033;
  --muted: #6c7589;
  --line: #e8ebf2;
  --primary: #315efb;
  --primary-dark: #254ad7;
  --primary-soft: #edf1ff;
  --success: #168a5b;
  --warning: #c77700;
  --danger: #d94242;
  --shadow: 0 18px 55px rgba(28, 39, 65, .09);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; margin: 0; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.view { flex: 1; min-width: 0; }
.site-footer { flex: 0 0 auto; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.site-footer a { display: inline-block; padding: 4px 0; color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.site-footer a:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 2px; }

.login-shell, .share-shell {
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 12% 15%, rgba(49,94,251,.12), transparent 27%),
    radial-gradient(circle at 88% 84%, rgba(39,187,144,.09), transparent 26%),
    var(--bg);
}

.login-card, .share-card {
  width: min(420px, 100%);
  padding: 42px;
  border: 1px solid rgba(224,228,238,.9);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(145deg, #4773ff, #244be5);
  box-shadow: 0 11px 24px rgba(49,94,251,.26);
}
.brand-mark svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark-small { width: 40px; height: 40px; margin: 0; border-radius: 12px; box-shadow: none; }
.brand-mark-small svg { width: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 11px; font-weight: 750; letter-spacing: .15em; }
h1, h2, h3, p { margin-top: 0; }
.login-card h1, .share-card h1 { margin-bottom: 10px; font-size: 30px; letter-spacing: -.04em; }
.login-copy { margin-bottom: 30px; color: var(--muted); line-height: 1.65; }
label { display: block; margin-bottom: 9px; color: #3d4659; font-size: 13px; font-weight: 650; }
input, select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #dce1eb;
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: white;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(49,94,251,.12); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { background: #f2f4f8; color: var(--text); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.password-wrap .icon-button { position: absolute; top: 5px; right: 5px; }
.form-error { min-height: 20px; margin: 8px 0 8px; color: var(--danger); font-size: 13px; }
.primary-button, .secondary-button, .text-button, .load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border-radius: 11px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}
.primary-button { border: 1px solid var(--primary); color: white; background: var(--primary); box-shadow: 0 8px 18px rgba(49,94,251,.18); }
.primary-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary-button svg, .secondary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.secondary-button { border: 1px solid #dfe3ec; color: #374155; background: white; box-shadow: none; }
.secondary-button:hover { border-color: #cbd2df; background: #f9fafc; }
.text-button { min-height: 36px; padding: 0 8px; border: 0; color: var(--muted); background: transparent; }
.text-button:hover { color: var(--text); }
.full-button { width: 100%; height: 48px; }
.secure-note { display: flex; align-items: center; gap: 7px; margin: 22px 0 0; color: #8a93a5; font-size: 12px; }
.secure-note svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.secure-note.centered { justify-content: center; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(225,229,238,.85);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px);
}
.brand-row, .top-actions, .page-heading, .page-actions, .card-heading, .upload-panel-heading, .dialog-heading, .selected-file { display: flex; align-items: center; }
.brand-row { gap: 12px; }
.brand-row > div:last-child { display: flex; align-items: center; gap: 9px; }
.brand-row strong { font-size: 16px; }
.storage-badge { padding: 4px 7px; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 700; }
.top-actions { gap: 8px; }
.content-wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 100px; }
.page-heading { justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.045em; }
.page-heading p:last-child { margin-bottom: 0; color: var(--muted); }
.page-actions { gap: 10px; }

.drop-zone {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 128px;
	margin-bottom: 0;
  padding: 26px 30px;
  border: 1.5px dashed #cbd4e5;
  border-radius: 18px;
  outline: none;
  background: rgba(255,255,255,.65);
  transition: border-color .18s, background .18s, transform .18s;
}
.drop-zone:focus, .drop-zone.is-dragging { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.drop-zone > div:nth-child(2) { min-width: 0; flex: 1; }
.drop-zone strong { display: block; margin-bottom: 6px; font-size: 15px; }
.drop-zone p { margin: 0; color: var(--muted); font-size: 13px; }
.drop-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.drop-icon svg { width: 29px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.files-card { overflow: hidden; min-height: 310px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 12px 34px rgba(25,38,65,.05); }
.card-heading { justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.card-heading > div { display: flex; align-items: baseline; gap: 10px; }
.card-heading h2 { margin: 0; font-size: 17px; }
.card-heading span { color: var(--muted); font-size: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 3px; min-height: 46px; overflow-x: auto; padding: 8px 20px; border-bottom: 1px solid var(--line); background: #fbfcfe; white-space: nowrap; }
.breadcrumb button { min-height: 30px; padding: 0 8px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.breadcrumb button:hover { color: var(--primary); background: var(--primary-soft); }
.breadcrumb button:last-child { color: var(--text); font-weight: 650; cursor: default; }
.breadcrumb .separator { color: #b5bdcb; font-size: 12px; }
.search-box { position: relative; width: min(260px, 45vw); margin: 0; }
.search-box input { height: 38px; padding-left: 38px; border-radius: 10px; background: var(--surface-soft); }
.search-box svg { position: absolute; z-index: 2; top: 10px; left: 12px; width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.state-panel { display: grid; justify-items: center; align-content: center; min-height: 225px; padding: 40px; color: var(--muted); text-align: center; }
.state-panel.compact { min-height: 100px; }
.state-panel h3 { margin-bottom: 7px; color: var(--text); font-size: 17px; }
.state-panel p { margin-bottom: 15px; font-size: 13px; }
.empty-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 14px; border-radius: 14px; color: #8792a8; background: #f1f3f7; }
.empty-icon svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.spinner { display: inline-block; width: 23px; height: 23px; border: 2px solid #d9deea; border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 24px; color: #8b94a6; background: #fbfcfd; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; }
td { padding: 15px 24px; border-top: 1px solid #f0f2f6; color: var(--muted); font-size: 13px; }
tbody tr:hover { background: #fbfcff; }
th:last-child, td:last-child { text-align: right; }
.file-cell { display: flex; align-items: center; gap: 12px; min-width: 260px; color: var(--text); }
.file-icon { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.file-icon.folder-icon { color: #c77d00; background: #fff5df; }
.file-name { overflow: hidden; max-width: min(42vw, 430px); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.folder-link { max-width: min(48vw, 520px); overflow: hidden; padding: 0; border: 0; color: var(--text); background: transparent; font-weight: 650; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.folder-link:hover { color: var(--primary); }
.row-actions { display: inline-flex; gap: 6px; }
.row-button { min-height: 32px; padding: 0 10px; border: 1px solid #e0e4ed; border-radius: 8px; color: #4b5569; background: white; font-size: 12px; cursor: pointer; }
.row-button:hover { border-color: #bcc7dc; color: var(--primary); }
.load-more { width: calc(100% - 48px); margin: 8px 24px 20px; border: 0; color: var(--primary); background: var(--primary-soft); }

.upload-panel { width: 100%; overflow: hidden; margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.upload-panel-heading { justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.upload-tasks { max-height: 330px; overflow-y: auto; }
.upload-task { padding: 15px 17px; border-top: 1px solid #f0f2f6; }
.upload-task:first-child { border-top: 0; }
.task-top, .task-meta, .task-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-top strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.task-state { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.progress-track { height: 5px; margin: 11px 0 8px; overflow: hidden; border-radius: 99px; background: #edf0f5; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #315efb, #6384ff); transition: width .2s; }
.upload-task.is-done .progress-bar { background: var(--success); }
.upload-task.is-error .progress-bar { background: var(--danger); }
.task-meta { color: var(--muted); font-size: 11px; }
.task-actions { justify-content: flex-end; margin-top: 9px; }
.task-actions button { padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 11px; cursor: pointer; }
.task-actions button.danger { color: var(--danger); }

.dialog { width: min(480px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px; background: transparent; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(17,25,42,.46); backdrop-filter: blur(4px); }
.dialog-card { padding: 26px; border-radius: 20px; background: white; }
.dialog-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.upload-dialog { width: min(720px, calc(100% - 28px)); }
.upload-dialog .dialog-card { max-height: min(86vh, 760px); overflow-y: auto; }
.dialog-drop-zone { min-height: 150px; }
.dialog-heading { justify-content: space-between; margin-bottom: 22px; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.dialog-close { font-size: 25px; font-weight: 300; }
.selected-file { gap: 12px; margin-bottom: 21px; padding: 13px; border-radius: 12px; background: var(--surface-soft); }
.selected-file > div:last-child { min-width: 0; display: grid; gap: 3px; }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.selected-file span:last-child { color: var(--muted); font-size: 11px; }
.file-badge { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.dialog select { margin-bottom: 15px; }
.share-result { display: flex; gap: 8px; margin-bottom: 9px; }
.share-result input { height: 42px; font-size: 12px; }
.share-result button { flex: 0 0 auto; }
.wide-dialog { width: min(680px, calc(100% - 28px)); }
.history-list { display: grid; gap: 9px; max-height: 430px; overflow-y: auto; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.history-item > div { min-width: 0; }
.history-item strong { display: block; overflow: hidden; margin-bottom: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.history-item span { color: var(--muted); font-size: 11px; }
.history-item.is-expired { opacity: .58; }

.share-card { text-align: center; }
.share-card .brand-mark { margin-right: auto; margin-left: auto; }
.share-card .eyebrow { text-align: center; }
.share-card .spinner { margin: 24px 0 10px; }
.share-card #share-loading p { color: var(--muted); }
.share-card h1 { overflow-wrap: anywhere; font-size: 24px; }
.share-meta { margin-bottom: 28px; color: var(--muted); line-height: 1.7; }
.toast-region { position: fixed; z-index: 100; top: 88px; right: 22px; display: grid; gap: 8px; }
.toast { min-width: 220px; max-width: 360px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: white; box-shadow: 0 12px 35px rgba(18,29,51,.13); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.is-error { border-color: #ffd7d7; color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } }

@media (max-width: 720px) {
  .login-card, .share-card { padding: 30px 24px; border-radius: 20px; }
  .topbar { min-height: 64px; padding: 0 16px; }
  .brand-row > div:last-child { display: grid; gap: 2px; }
  .top-actions .secondary-button:first-child { display: none; }
  .top-actions button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .content-wrap { width: min(100% - 24px, 1180px); padding-top: 30px; }
  .page-heading { align-items: flex-end; }
	.page-actions { align-items: stretch; flex-direction: column-reverse; }
	.page-actions button { min-height: 38px; padding: 0 11px; font-size: 12px; }
	.page-actions button svg { display: none; }
  .drop-zone { align-items: flex-start; padding: 20px; }
  .drop-zone .secondary-button { display: none; }
  .card-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { display: none; }
  th, td { padding-right: 16px; padding-left: 16px; }
  .file-name { max-width: 42vw; }
	.dialog-drop-zone { align-items: center; flex-direction: column; text-align: center; }
	.dialog-drop-zone .secondary-button { display: inline-flex; }
  .history-item { align-items: flex-start; flex-direction: column; }
}
