:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1f2329;
  --muted: #7a828e;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
button, input, select { font-family: inherit; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 380px; max-width: calc(100% - 32px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 8px 30px rgba(0,0,0,.05);
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; margin-bottom: 18px;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.login-sub { margin: 0 0 28px; color: var(--muted); }
.login-card label { display: block; margin-bottom: 8px; font-weight: 500; }
.login-card input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 8px; outline: none;
}
.login-card input:focus { border-color: var(--primary); }
.error { color: var(--danger); min-height: 20px; margin-top: 8px; font-size: 13px; }
.hint { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.logo-icon {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.storage-info { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.storage-bar { width: 110px; height: 6px; background: #e9edf2; border-radius: 3px; overflow: hidden; }
.storage-bar > div { height: 100%; background: var(--primary); width: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 200px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); cursor: pointer; }
.crumbs a:hover { color: var(--primary); }
.crumbs span { color: var(--muted); }

.btn {
  padding: 8px 14px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; cursor: pointer; color: var(--text);
}
.btn:hover { border-color: #cbd2da; background: #fafbfc; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.file-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.file-head, .file-row {
  display: grid; grid-template-columns: 1fr 120px 150px 200px;
  align-items: center; padding: 12px 18px; gap: 12px;
}
.file-head { background: #fafbfc; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); }
.file-row { border-bottom: 1px solid #f0f2f4; }
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: #fafbfc; }
.file-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name .ico { width: 26px; text-align: center; font-size: 17px; }
.file-name .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.file-name .label:hover { color: var(--primary); }
.file-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }

.drop-mask {
  position: fixed; inset: 0; background: rgba(37,99,235,.12);
  border: 3px dashed var(--primary); z-index: 100; display: none;
  align-items: center; justify-content: center; font-size: 20px; color: var(--primary); font-weight: 600;
}
.drop-mask.show { display: flex; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(20,24,30,.45);
  z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 14px; width: 520px; max-width: 100%;
  max-height: 88vh; overflow: auto; padding: 24px;
}
.modal.wide { width: 760px; }
.modal h2 { margin: 0 0 18px; font-size: 18px; font-weight: 600; }
.modal .close { float: right; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; border: none; background: none; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number], .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--primary); }
.form-row .desc { color: var(--muted); font-size: 12px; margin-top: 5px; }
.radio-group { display: flex; gap: 12px; }
.radio-card {
  flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  cursor: pointer; position: relative;
}
.radio-card.active { border-color: var(--primary); background: #eff5ff; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card b { display: block; margin-bottom: 4px; }
.radio-card span { color: var(--muted); font-size: 12px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.preview-body { background: #111418; border-radius: 10px; min-height: 320px; display: flex; align-items: center; justify-content: center; overflow: auto; }
.preview-body img { max-width: 100%; max-height: 70vh; }
.preview-body video { max-width: 100%; max-height: 70vh; }
.preview-body iframe { width: 100%; height: 70vh; border: none; }
.preview-body pre { color: #d8dee9; padding: 20px; white-space: pre-wrap; word-break: break-all; font-size: 13px; }

.upload-list { position: fixed; right: 20px; bottom: 20px; width: 320px; z-index: 300; }
.upload-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.upload-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px; }
.upload-progress { height: 5px; background: #e9edf2; border-radius: 3px; overflow: hidden; }
.upload-progress > div { height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.upload-status { font-size: 12px; color: var(--muted); margin-top: 5px; }

.share-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f2f4; }
.share-row:last-child { border-bottom: none; }
.share-row .info { flex: 1; min-width: 0; }
.share-row .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row .info span { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #eef2ff; color: #4338ca; }
.tag.download { background: #ecfdf5; color: #047857; }
.tag.expired { background: #fef2f2; color: var(--danger); }

.share-page { max-width: 860px; margin: 0 auto; padding: 40px 20px; }
.share-header { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 16px; }
.share-header h1 { margin: 0 0 6px; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.share-header p { margin: 0; color: var(--muted); font-size: 13px; }
.badge { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 20px; font-size: 12px; background: #eef2ff; color: #4338ca; }
.badge.download { background: #ecfdf5; color: #047857; }
.gate { text-align: center; padding: 50px 20px; }
.gate input { padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; width: 240px; outline: none; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.share-download { margin: 14px 0 4px; }
.share-download .btn { padding: 12px 20px; font-size: 14px; width: 100%; }
@media (max-width: 720px) {
  .file-head, .file-row { grid-template-columns: 1fr 80px 110px; }
  .file-head div:nth-child(3), .file-row > div:nth-child(3) { display: none; }
  .container { padding: 14px; }
  .share-page .file-head, .share-page .file-row { grid-template-columns: 1fr 58px 104px; }
  .share-page .file-head div:nth-child(3) { display: block; }
  .share-page .file-row > div:nth-child(3) { display: flex; justify-content: flex-end; }
  .share-page .file-head div:nth-child(4), .share-page .file-row > div:nth-child(4) { display: none; }
  .share-page .file-row > div:nth-child(3) .btn { padding: 6px 8px; font-size: 12px; }
}
