:root {
  --bg: #060a12;
  --bg-2: #0a111e;
  --panel: #0e1626;
  --panel-2: #111b2e;
  --line: rgba(148, 163, 184, .13);
  --line-2: rgba(148, 163, 184, .24);
  --text: #e9eefb;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --brand: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #a855f7;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 16px;
  --sidebar: 264px;
  --shadow: 0 30px 90px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: #a5b4fc; text-decoration: none; }
a:hover { color: #e0e7ff; }
img { max-width: 100%; }
::selection { background: rgba(99, 102, 241, .45); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .35); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .55); background-clip: padding-box; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.gradient-text {
  background: linear-gradient(92deg, #a5b4fc 0%, #67e8f9 55%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  width: 1em;
  height: 1em;
}
.icon svg { width: 100%; height: 100%; display: block; }

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 10% -12%, rgba(99, 102, 241, .26), transparent 62%),
    radial-gradient(800px 600px at 100% -5%, rgba(34, 211, 238, .15), transparent 58%),
    radial-gradient(900px 760px at 52% 125%, rgba(168, 85, 247, .13), transparent 62%),
    var(--bg);
}
.bg-aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 75%);
}

/* ---------- buttons / fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
  transition: transform .15s, background .18s, border .18s, opacity .18s, filter .18s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5 46%, #0891b2);
  border-color: rgba(165, 180, 252, .26);
  box-shadow: 0 10px 30px rgba(79, 70, 229, .3);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); color: #cbd5e1; }
.btn.ghost:hover { background: rgba(255, 255, 255, .04); }
.btn.danger { background: rgba(248, 113, 113, .11); border-color: rgba(248, 113, 113, .34); color: #fecaca; }
.btn.danger:hover { background: rgba(248, 113, 113, .18); }
.btn.sm { padding: 8px 12px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn .icon { font-size: 16px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border .15s;
  font-size: 18px;
}
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.icon-btn.bordered { border-color: var(--line); background: #080e19; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }

.field { display: grid; gap: 7px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.input-wrap { position: relative; }
.input-wrap > .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 16px;
  pointer-events: none;
}
.input, .select, .textarea {
  width: 100%;
  background: #080e19;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 13px;
  font-size: 14px;
  outline: none;
  transition: border .18s, box-shadow .18s, background .18s;
}
.input-wrap .input { padding-left: 40px; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(99, 102, 241, .65);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
  background: #0a111f;
}
.input::placeholder, .textarea::placeholder { color: #4d5b72; }
.textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.form-error {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, .09);
  border: 1px solid rgba(248, 113, 113, .28);
  color: #fecaca;
  font-size: 12px;
  line-height: 1.55;
}
.form-error.show { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.help { font-size: 11px; color: var(--muted-2); line-height: 1.6; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 650; border: 1px solid transparent; white-space: nowrap; }
.badge.green { color: #86efac; background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .22); }
.badge.amber { color: #fde68a; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .24); }
.badge.red { color: #fecaca; background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .26); }
.badge.blue { color: #a5f3fc; background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .22); }
.badge.gray { color: #cbd5e1; background: rgba(148, 163, 184, .08); border-color: rgba(148, 163, 184, .18); }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* ---------- auth ---------- */
.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 28px;
  padding: 48px clamp(20px, 5vw, 84px);
  max-width: 1460px;
  margin: 0 auto;
}
.auth-brand { padding-right: 24px; animation: fadeUp .5s ease both; }
.brand-mark { display: flex; align-items: center; gap: 12px; }
.brand-mark img { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 12px 30px rgba(34, 211, 238, .18); }
.brand-name { font-weight: 750; font-size: 19px; letter-spacing: .2px; }
.brand-name span { color: var(--muted); font-weight: 500; }
.auth-title { font-size: clamp(36px, 4.5vw, 62px); line-height: 1.06; letter-spacing: -1.8px; margin: 36px 0 18px; font-weight: 780; }
.auth-sub { color: var(--muted); font-size: 15px; line-height: 1.9; max-width: 540px; margin: 0; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .025); color: #c7d2e6; font-size: 12.5px; }
.pill .icon { font-size: 14px; color: #67e8f9; }
.auth-side-stats { display: flex; gap: 34px; margin-top: 40px; color: var(--muted-2); font-size: 11.5px; }
.auth-side-stats b { display: block; color: var(--text); font-size: 21px; margin-bottom: 3px; letter-spacing: -.5px; }
.auth-card {
  width: 100%;
  max-width: 480px;
  justify-self: end;
  background: linear-gradient(180deg, rgba(17, 26, 45, .94), rgba(9, 15, 27, .96));
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 26px;
  padding: 30px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(26px);
  animation: fadeUp .55s .08s ease both;
}
.auth-tabs { display: flex; background: #080e19; border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 13px; cursor: pointer; transition: .18s; }
.auth-tab.active { background: linear-gradient(135deg, rgba(99, 102, 241, .24), rgba(34, 211, 238, .12)); color: #fff; box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .25); }
.auth-form { display: grid; gap: 14px; }
.auth-foot { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted-2); gap: 12px; }
.auth-foot a { color: #a5b4fc; }
.dev-banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .24); color: #a5f3fc; font-size: 12px; line-height: 1.6; }
.dev-banner .icon { margin-top: 1px; color: #22d3ee; }
.dev-banner b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: 2px; color: #fff; }
.auth-note { margin-top: 16px; font-size: 10.5px; color: #4f5f77; line-height: 1.7; text-align: center; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(8, 14, 25, .76);
  backdrop-filter: blur(26px);
  z-index: 30;
}
.sidebar .brand-mark img { width: 38px; height: 38px; border-radius: 12px; }
.sidebar .brand-name { font-size: 16px; }
.sidebar .brand-name span { font-size: 11px; display: block; margin-top: 1px; }
.nav { margin-top: 26px; display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 600; border: 1px solid transparent; transition: .16s; }
.nav-item:hover { background: rgba(255, 255, 255, .045); color: #dbe4f5; }
.nav-item.active { background: linear-gradient(90deg, rgba(99, 102, 241, .18), rgba(34, 211, 238, .05)); border-color: rgba(99, 102, 241, .22); color: #fff; }
.nav-item .icon { font-size: 18px; }
.nav-section { margin: 20px 12px 7px; font-size: 10px; letter-spacing: 1.7px; text-transform: uppercase; color: #526179; }
.storage-card { margin-top: auto; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.storage-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 9px; gap: 8px; }
.storage-top b { color: var(--text); font-weight: 650; }
.storage-bar { height: 6px; border-radius: 99px; background: #09111f; overflow: hidden; }
.storage-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #22d3ee); transition: width .45s ease; }
.storage-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 7px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); cursor: pointer; transition: .16s; }
.user-chip:hover { background: rgba(255, 255, 255, .045); }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #6366f1, #22d3ee); color: #fff; font-weight: 750; font-size: 14px; flex: 0 0 auto; }
.avatar.lg { width: 54px; height: 54px; border-radius: 17px; font-size: 21px; }
.user-meta { min-width: 0; flex: 1; }
.user-meta b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.user-chip > .icon { color: var(--muted-2); font-size: 15px; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: rgba(6, 10, 18, .7);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); min-width: 0; flex: 1; }
.crumb { color: var(--muted); text-decoration: none; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb:hover { color: #fff; }
.crumb.current { color: #e9eefb; font-weight: 650; }
.crumb-sep { color: #3b4a61; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search { position: relative; width: 260px; }
.search > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 15px; }
.search input { width: 100%; padding: 9px 12px 9px 34px; border-radius: 10px; border: 1px solid var(--line); background: #080e19; color: var(--text); font-size: 12.5px; outline: none; }
.search input:focus { border-color: rgba(99, 102, 241, .5); }
.mobile-brand { display: none; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.mobile-search-btn { display: none; }
.mobile-brand img { width: 28px; height: 28px; border-radius: 9px; }
.page { padding: 26px 30px 90px; width: 100%; max-width: 1500px; margin: 0 auto; animation: fadeUp .35s ease both; }
.mobile-nav { display: none; }
.fab { display: none; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-size: 26px; font-weight: 760; letter-spacing: -.7px; margin: 0; }
.page-sub { font-size: 12px; color: var(--muted-2); margin-top: 5px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.segmented { display: flex; padding: 3px; background: #080e19; border: 1px solid var(--line); border-radius: 10px; }
.segmented button { border: 0; background: transparent; color: var(--muted-2); padding: 7px 9px; border-radius: 8px; cursor: pointer; display: flex; font-size: 15px; }
.segmented button.active { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- files ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 152px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 26, 45, .72), rgba(10, 17, 30, .66));
  cursor: pointer;
  transition: transform .18s, border .18s, background .18s;
  overflow: hidden;
}
.file-card:hover { transform: translateY(-3px); border-color: rgba(129, 140, 248, .36); background: linear-gradient(180deg, rgba(23, 34, 58, .86), rgba(11, 19, 34, .82)); }
.file-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(300px 100px at 82% 0%, rgba(99, 102, 241, .1), transparent 70%); pointer-events: none; }
.file-card.status-blocked { border-color: rgba(239, 68, 68, .3); }
.file-card.status-suspicious { border-color: rgba(245, 158, 11, .26); }
.file-thumb {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(99, 102, 241, .13);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, .18);
  margin-bottom: 18px;
  overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb.folder { background: rgba(34, 211, 238, .1); color: #67e8f9; border-color: rgba(34, 211, 238, .18); }
.file-thumb.zip { background: rgba(251, 191, 36, .1); color: #fcd34d; border-color: rgba(251, 191, 36, .18); }
.file-thumb.apk { background: rgba(52, 211, 153, .1); color: #6ee7b7; border-color: rgba(52, 211, 153, .18); }
.file-thumb.img { background: rgba(168, 85, 247, .12); color: #d8b4fe; border-color: rgba(168, 85, 247, .2); }
.file-thumb.doc { background: rgba(96, 165, 250, .1); color: #93c5fd; border-color: rgba(96, 165, 250, .18); }
.file-thumb.media { background: rgba(248, 113, 113, .1); color: #fca5a5; border-color: rgba(248, 113, 113, .18); }
.file-thumb.text { background: rgba(148, 163, 184, .1); color: #cbd5e1; border-color: rgba(148, 163, 184, .16); }
.file-name { font-size: 13.5px; font-weight: 650; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.file-sub { font-size: 11px; color: var(--muted-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: #475569; flex: 0 0 auto; }
.file-badge { position: absolute; top: 12px; right: 12px; }
.more-btn { position: absolute; bottom: 9px; right: 9px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted-2); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s, background .15s; font-size: 17px; }
.file-card:hover .more-btn { opacity: 1; }
.more-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.file-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(10, 17, 30, .52); }
.file-row { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: rgba(255, 255, 255, .03); }
.file-row .file-thumb { width: 34px; height: 34px; margin: 0; border-radius: 9px; font-size: 17px; }
.file-row .name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .size, .file-row .date { font-size: 11px; color: var(--muted-2); width: 88px; text-align: right; flex: 0 0 auto; }
.file-row .badge { flex: 0 0 auto; }
.file-row .row-more { flex: 0 0 auto; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-art { width: 120px; height: 120px; margin-bottom: 18px; opacity: .9; }
.empty h3 { color: #dbe4f5; font-size: 16px; margin: 0 0 7px; }
.empty p { font-size: 12.5px; color: var(--muted-2); max-width: 330px; line-height: 1.7; margin: 0 0 18px; }

/* ---------- upload ---------- */
.upload-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, #111a2e, #0a111f);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
  animation: popIn .2s ease;
}
.upload-head { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.upload-head strong { font-size: 13px; flex: 1; }
.upload-head span { font-size: 11px; color: var(--muted-2); }
.upload-body { max-height: 300px; overflow: auto; padding: 9px 12px; }
.upload-item { padding: 9px 4px; }
.upload-line { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.upload-line .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-line .pct { color: var(--muted-2); font-size: 11px; }
.progress { height: 5px; background: #070d18; border-radius: 99px; overflow: hidden; margin-top: 7px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6366f1, #22d3ee); transition: width .2s; }
.upload-item.error .progress span { background: var(--red); }
.upload-item.done .progress span { background: var(--green); }

/* ---------- modal ---------- */
.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 14, .72); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s; }
.modal { width: min(560px, 100%); max-height: min(86dvh, 900px); overflow: auto; background: linear-gradient(180deg, #111a2e, #0a111f); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 40px 120px rgba(0, 0, 0, .62); animation: popIn .22s cubic-bezier(.2, .8, .3, 1); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(17, 26, 46, .95); backdrop-filter: blur(14px); z-index: 2; }
.modal-head h3 { font-size: 15px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 20px; }
.modal-foot { padding: 12px 20px 20px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.menu-list { display: grid; gap: 4px; }
.menu-item { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 11px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; font-size: 13px; width: 100%; }
.menu-item:hover { background: rgba(255, 255, 255, .055); }
.menu-item .icon { color: var(--muted); font-size: 17px; }
.menu-item.danger { color: #fca5a5; }
.menu-item.danger .icon { color: #f87171; }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }

.preview-media { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #050a13; display: flex; align-items: center; justify-content: center; min-height: 160px; max-height: 46dvh; margin-bottom: 16px; }
.preview-media img, .preview-media video { max-width: 100%; max-height: 46dvh; display: block; }
.preview-media audio { width: 100%; padding: 20px; }
.preview-media pre { margin: 0; padding: 16px; width: 100%; max-height: 46dvh; overflow: auto; font-size: 12px; line-height: 1.65; color: #cbd5e1; white-space: pre-wrap; word-break: break-word; }
.preview-icon { width: 92px; height: 92px; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 42px; background: rgba(99, 102, 241, .1); border: 1px solid rgba(99, 102, 241, .2); color: #a5b4fc; margin: 28px auto; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.meta-item { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); min-width: 0; }
.meta-item .k { font-size: 10px; color: var(--muted-2); margin-bottom: 3px; }
.meta-item .v { font-size: 12px; color: #dbe4f5; word-break: break-all; }
.scan-list { display: grid; gap: 8px; margin-top: 8px; }
.scan-item { display: flex; gap: 9px; padding: 10px 11px; border-radius: 10px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); font-size: 11.5px; line-height: 1.55; color: #cbd5e1; }
.scan-item .icon { margin-top: 1px; }
.scan-item.danger { border-color: rgba(239, 68, 68, .22); background: rgba(239, 68, 68, .06); color: #fecaca; }
.scan-item.warn { border-color: rgba(245, 158, 11, .22); background: rgba(245, 158, 11, .06); color: #fde68a; }
.scan-item.info { border-color: rgba(34, 211, 238, .16); background: rgba(34, 211, 238, .05); color: #a5f3fc; }
.notice { padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.notice.danger { border-color: rgba(239, 68, 68, .28); background: rgba(239, 68, 68, .07); color: #fecaca; }
.notice.warn { border-color: rgba(245, 158, 11, .28); background: rgba(245, 158, 11, .07); color: #fde68a; }

.link-box { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: #080e19; }
.link-box input { flex: 1; min-width: 0; background: transparent; border: 0; color: #a5f3fc; font-size: 11.5px; outline: none; font-family: ui-monospace, monospace; }
.share-existing { margin-top: 16px; display: grid; gap: 7px; }
.share-row { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 11.5px; min-width: 0; }
.share-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.share-row .grow .help { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- admin ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.stat-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(17, 26, 45, .8), rgba(10, 17, 30, .7)); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(99, 102, 241, .12); color: #a5b4fc; margin-bottom: 12px; font-size: 17px; }
.stat-card.green .stat-icon { background: rgba(34, 197, 94, .1); color: #86efac; }
.stat-card.amber .stat-icon { background: rgba(245, 158, 11, .1); color: #fde68a; }
.stat-card.red .stat-icon { background: rgba(239, 68, 68, .1); color: #fca5a5; }
.stat-value { font-size: 24px; font-weight: 760; letter-spacing: -.6px; }
.stat-label { font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: rgba(10, 17, 30, .6); overflow: hidden; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 13px; margin: 0; flex: 1; }
.panel-body { padding: 16px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; padding: 10px 14px; color: var(--muted-2); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid rgba(148, 163, 184, .07); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255, 255, 255, .02); }
.table-file { display: flex; align-items: center; gap: 9px; min-width: 0; }
.table-file .file-thumb { width: 28px; height: 28px; margin: 0; border-radius: 8px; font-size: 14px; }
.table-file .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.table-owner { color: var(--muted); font-size: 11px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-tab { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.filter-tab.active { background: rgba(99, 102, 241, .14); border-color: rgba(99, 102, 241, .3); color: #c7d2fe; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: 220px; }
.mini-list { display: grid; gap: 8px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(148, 163, 184, .07); font-size: 12px; }
.mini-row:last-child { border-bottom: 0; }
.mini-row .grow { flex: 1; min-width: 0; }
.mini-row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mini-row .grow span { color: var(--muted-2); font-size: 10.5px; }
.role-badge { font-size: 10px; padding: 3px 7px; border-radius: 99px; background: rgba(99, 102, 241, .12); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, .2); white-space: nowrap; }
.role-badge.owner { background: rgba(245, 158, 11, .12); color: #fde68a; border-color: rgba(245, 158, 11, .25); }
.role-badge.admin { background: rgba(34, 211, 238, .1); color: #a5f3fc; border-color: rgba(34, 211, 238, .2); }
.role-badge.auditor { background: rgba(168, 85, 247, .12); color: #e9d5ff; border-color: rgba(168, 85, 247, .22); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 0; }
.settings-grid > * { min-width: 0; }
.settings-card { border: 1px solid var(--line); border-radius: 18px; background: rgba(10, 17, 30, .6); padding: 18px; min-width: 0; }
.auth-form, .form-grid, .field, .input, .select, .textarea { min-width: 0; }
.input, .select, .textarea { max-width: 100%; }
.settings-card h3 { font-size: 13px; margin: 0 0 4px; }
.settings-card .desc { font-size: 11px; color: var(--muted-2); margin-bottom: 16px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #cbd5e1; padding: 5px 0; }
.check-row input { width: 16px; height: 16px; accent-color: #6366f1; }
.log-item { padding: 11px 2px; border-bottom: 1px solid rgba(148, 163, 184, .07); font-size: 12px; }
.log-item:last-child { border-bottom: 0; }
.log-action { font-weight: 650; }
.log-meta { color: var(--muted-2); font-size: 10.5px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.log-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* ---------- public share ---------- */
.share-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.share-card { width: min(560px, 100%); background: linear-gradient(180deg, rgba(17, 26, 45, .95), rgba(9, 15, 27, .96)); border-radius: 26px; padding: 30px; text-align: center; border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: fadeUp .4s ease both; }
.share-icon { width: 70px; height: 70px; border-radius: 21px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; font-size: 31px; background: rgba(99, 102, 241, .12); border: 1px solid rgba(99, 102, 241, .22); color: #a5b4fc; }
.share-name { font-size: 20px; font-weight: 720; word-break: break-all; line-height: 1.4; }
.share-meta { color: var(--muted-2); font-size: 12px; margin-top: 7px; }
.share-actions { margin-top: 22px; display: grid; gap: 10px; }
.share-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.share-brand img { width: 28px; height: 28px; border-radius: 9px; }

/* ---------- toast ---------- */
.toast-root { position: fixed; top: 84px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 12px; background: #101a2e; border: 1px solid var(--line-2); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); font-size: 12.5px; line-height: 1.5; animation: slideIn .2s ease; }
.toast.success { border-color: rgba(34, 197, 94, .3); }
.toast.error { border-color: rgba(239, 68, 68, .36); }
.toast .icon { margin-top: 1px; font-size: 16px; }
.toast.success .icon { color: #86efac; }
.toast.error .icon { color: #fca5a5; }
.toast.info .icon { color: #a5f3fc; }

/* ---------- animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.pulse { animation: pulse 1.4s ease-in-out infinite; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; padding: 28px 18px 40px; gap: 22px; }
  .auth-brand { padding: 0; text-align: center; }
  .brand-mark { justify-content: center; }
  .auth-title { font-size: clamp(32px, 8vw, 44px); margin: 22px 0 12px; }
  .auth-sub { margin: 0 auto; font-size: 13px; line-height: 1.8; }
  .feature-pills, .auth-side-stats { display: none; }
  .auth-card { justify-self: center; max-width: 520px; padding: 24px; border-radius: 22px; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 14px; height: 62px; gap: 10px; }
  .topbar .search { display: none; }
  .breadcrumb { font-size: 12px; }
  .page { padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 22px; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .file-card { min-height: 140px; padding: 13px; }
  .file-thumb { width: 40px; height: 40px; font-size: 19px; margin-bottom: 14px; }
  .more-btn { opacity: 1; }
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(7, 12, 22, .93); backdrop-filter: blur(22px); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted-2); text-decoration: none; font-size: 10px; padding: 4px 12px; border-radius: 10px; }
  .mobile-nav a.active { color: #c7d2fe; }
  .mobile-nav .icon { font-size: 20px; }
  .fab { display: flex; position: fixed; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 55; width: 54px; height: 54px; border-radius: 18px; border: 1px solid rgba(165, 180, 252, .3); background: linear-gradient(135deg, #6366f1, #0891b2); color: #fff; align-items: center; justify-content: center; box-shadow: 0 16px 40px rgba(79, 70, 229, .45); font-size: 24px; }
  .fab.hidden { display: none; }
  .upload-panel { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; border-radius: 18px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 88dvh; width: 100%; }
  .modal.wide { width: 100%; }
  .modal-head { padding: 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
  .settings-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .file-row .size, .file-row .date { display: none; }
  .toast-root { top: 72px; right: 10px; left: 10px; max-width: none; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-recent th:nth-child(3), .table-recent td:nth-child(3),
  .table-recent th:nth-child(5), .table-recent td:nth-child(5) { display: none; }
  .table-users th:nth-child(3), .table-users td:nth-child(3),
  .table-users th:nth-child(4), .table-users td:nth-child(4),
  .table-users th:nth-child(6), .table-users td:nth-child(6) { display: none; }
  .table-files th:nth-child(2), .table-files td:nth-child(2),
  .table-files th:nth-child(3), .table-files td:nth-child(3),
  .table-files th:nth-child(5), .table-files td:nth-child(5) { display: none; }
  .table-shares th:nth-child(2), .table-shares td:nth-child(2),
  .table-shares th:nth-child(3), .table-shares td:nth-child(3),
  .table-shares th:nth-child(4), .table-shares td:nth-child(4) { display: none; }
  .table-wrap th, .table-wrap td { padding: 10px 8px; }
  .table-file .name { max-width: 150px; }
  .table-owner { max-width: 110px; }
  .table-files .row-actions { width: 92px; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
  .table-files th:last-child, .table-files td:last-child { width: 96px; }
  .table-files .icon-btn.sm { width: 26px; height: 26px; font-size: 14px; }
  .share-card { padding: 24px 20px; }
  .meta-grid { grid-template-columns: 1fr; }
  .mobile-brand { display: flex; }
  .mobile-search-btn { display: inline-flex; }
  .breadcrumb { display: none; }
}
@media (max-width: 380px) {
  .file-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .btn { padding: 10px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
