:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --sidebar: #101827;
  --sidebar-2: #172235;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #7f8da3;
  --text: #172033;
  --muted: #667085;
  --line: #e4e8ef;
  --line-strong: #d3dae5;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --accent-2: #0ea5e9;
  --green: #059669;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #d97706;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.icon-slot {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.icon-slot svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon-xl {
  width: 44px;
  height: 44px;
}

/* ---------------- 登录 ---------------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 8vw;
  background: linear-gradient(135deg, #0d1626 0%, #15253f 52%, #0e1a2e 100%);
  position: relative;
  overflow: hidden;
}

.login-art {
  position: relative;
  width: min(440px, 36vw);
  height: 340px;
  display: none;
}

.login-art-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: 24px;
  mask-image: radial-gradient(circle at center, #000 30%, transparent 78%);
}

.sticky {
  position: absolute;
  padding: 18px 22px;
  border-radius: 6px;
  font-weight: 650;
  color: #20304b;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  transform: rotate(-5deg);
  background: #fef08a;
}

.sticky-a {
  top: 34px;
  left: 18px;
}

.sticky-b {
  top: 130px;
  right: 8px;
  background: #bfdbfe;
  transform: rotate(4deg);
}

.sticky-c {
  bottom: 28px;
  left: 76px;
  background: #bbf7d0;
  transform: rotate(-2deg);
}

.login-card {
  width: min(400px, 100%);
  background: var(--panel);
  border-radius: 22px;
  padding: 34px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.login-brand h1 {
  font-size: 22px;
  margin: 0 0 3px;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  flex: 0 0 auto;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 7px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 11px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.login-tip {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin: 18px 0 0;
  line-height: 1.6;
}

.btn {
  border: 1px solid transparent;
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-ghost {
  background: var(--panel);
  border-color: var(--line-strong);
  color: #344054;
}

.btn-ghost:hover {
  background: var(--panel-soft);
  border-color: #c2ccdb;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger-ghost {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
}

.btn-wide {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(148, 163, 184, 0.16);
}

/* ---------------- 应用框架 ---------------- */

.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 246px;
  flex: 0 0 246px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.brand-text span {
  color: var(--sidebar-muted);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  color: var(--sidebar-text);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.95), rgba(14, 165, 233, 0.75));
  color: #fff;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.25);
}

.nav-sep {
  height: 1px;
  background: rgba(148, 163, 184, 0.16);
  margin: 9px 8px;
}

.storage-card {
  margin-top: auto;
  background: rgba(148, 163, 184, 0.09);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 12px 13px;
}

.storage-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--sidebar-text);
  font-weight: 600;
}

.storage-bar {
  height: 6px;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 99px;
  overflow: hidden;
  margin: 9px 0 7px;
}

.storage-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  border-radius: inherit;
  transition: width 0.4s;
}

.storage-sub {
  font-size: 11px;
  color: var(--sidebar-muted);
  line-height: 1.5;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 6px 2px;
  margin-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 14px;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.sidebar-user-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-user-text strong {
  color: #fff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-text span {
  color: var(--sidebar-muted);
  font-size: 11px;
  margin-top: 1px;
}

.sidebar-user .icon-btn {
  color: var(--sidebar-text);
  margin-left: auto;
}

.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mobile-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--sidebar);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.mobile-bar strong {
  font-size: 15px;
}

.mobile-bar .avatar {
  margin-left: auto;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 22px 30px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.title-block {
  min-width: 180px;
}

.title-block h1 {
  font-size: 23px;
  margin: 0;
  letter-spacing: -0.2px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 5px;
}

.breadcrumb a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.breadcrumb .sep {
  color: #b3bdcb;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 11px;
  height: 38px;
  color: var(--muted);
  min-width: 190px;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  color: var(--text);
}

.search-box input::-webkit-search-cancel-button {
  cursor: pointer;
}

.view-toggle {
  display: inline-flex;
  background: #e9edf3;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.view-toggle button {
  border: 0;
  background: transparent;
  width: 32px;
  height: 30px;
  border-radius: 7px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-toggle button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.content {
  flex: 1;
  padding: 4px 30px 40px;
  background-image: radial-gradient(#dde4ee 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

/* ---------------- 文件列表 ---------------- */

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 4px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.items {
  display: grid;
  gap: 14px;
}

.items.grid {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}

.items.list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  min-width: 0;
}

.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  border-color: #cfd8e5;
}

.folder-card {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.folder-glyph {
  width: 46px;
  height: 40px;
  flex: 0 0 auto;
  color: #f0b429;
}

.folder-glyph svg {
  width: 100%;
  height: 100%;
}

.folder-info {
  min-width: 0;
  flex: 1;
}

.folder-name {
  font-weight: 650;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.file-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.thumb {
  aspect-ratio: 4 / 3;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.filetype {
  width: 66px;
  height: 78px;
  border-radius: 9px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  position: relative;
}

.filetype::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-width: 0 16px 16px 0;
  border-style: solid;
  border-color: transparent rgba(255, 255, 255, 0.38) transparent transparent;
  border-radius: 0 9px 0 0;
}

.filetype .icon-slot {
  width: 22px;
  height: 22px;
}

.filetype.image {
  background: linear-gradient(135deg, #34d399, #059669);
}
.filetype.pdf {
  background: linear-gradient(135deg, #fb7185, #dc2626);
}
.filetype.document {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}
.filetype.video {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
}
.filetype.audio {
  background: linear-gradient(135deg, #f472b6, #db2777);
}
.filetype.archive {
  background: linear-gradient(135deg, #fbbf24, #d97706);
}
.filetype.other {
  background: linear-gradient(135deg, #94a3b8, #475569);
}

.file-body {
  padding: 11px 13px 12px;
  min-width: 0;
}

.file-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c0c8d4;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 99px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-temp {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-shared {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-owner {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.item-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  z-index: 2;
}

.item:hover .item-menu,
.item:focus-within .item-menu {
  opacity: 1;
}

.item-menu:hover {
  background: #fff;
  color: var(--text);
}

/* 列表布局 */
.items.list .item {
  border-radius: 12px;
}

.items.list .file-card {
  flex-direction: row;
  align-items: center;
  padding: 9px 12px;
  gap: 12px;
}

.items.list .thumb {
  width: 46px;
  height: 46px;
  aspect-ratio: auto;
  border-radius: 9px;
  flex: 0 0 auto;
}

.items.list .thumb img {
  border-radius: 9px;
}

.items.list .filetype {
  width: 38px;
  height: 44px;
  border-radius: 7px;
  font-size: 9px;
  box-shadow: none;
}

.items.list .filetype .icon-slot {
  width: 16px;
  height: 16px;
}

.items.list .filetype::after {
  border-width: 0 10px 10px 0;
}

.items.list .file-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  padding: 0;
}

.items.list .file-name {
  flex: 1;
  min-width: 0;
}

.items.list .file-meta {
  margin: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.items.list .item-menu {
  position: static;
  opacity: 1;
  background: transparent;
  flex: 0 0 auto;
}

.items.list .folder-card {
  padding: 11px 14px;
}

.items.list .folder-glyph {
  width: 36px;
  height: 32px;
}

.items.list .folder-card .item-menu {
  position: static;
  opacity: 1;
  background: transparent;
}

.items.list .folder-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.items.list .folder-meta {
  margin: 0;
}

/* 空状态/加载 */
.empty {
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  margin-top: 20px;
}

.empty .icon-slot {
  width: 50px;
  height: 50px;
  color: #b4c0d1;
  margin-bottom: 12px;
}

.empty h3 {
  color: var(--text);
  font-size: 16px;
  margin: 0 0 6px;
}

.empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 70px 20px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #dbe2ec;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint-bar {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 11px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.6;
}

/* 分享给我的头部 */
.shared-owner {
  color: var(--muted);
  font-size: 12px;
}

/* ---------------- 菜单 ---------------- */

.context-menu {
  position: fixed;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
  padding: 6px;
  min-width: 172px;
  max-width: 240px;
}

.context-menu button,
.context-menu a {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  font-weight: 500;
}

.context-menu button:hover,
.context-menu a:hover {
  background: var(--panel-soft);
}

.context-menu .danger {
  color: var(--danger);
}

.context-menu .danger:hover {
  background: var(--danger-soft);
}

.context-menu .menu-sep {
  height: 1px;
  background: var(--line);
  margin: 5px 6px;
}

.context-menu .menu-label {
  padding: 7px 10px 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------------- 模态框 ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fadeIn 0.16s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: #fff;
  border-radius: 18px;
  width: min(480px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.36);
  overflow: hidden;
  animation: popIn 0.18s ease;
}

@keyframes popIn {
  from {
    transform: translateY(8px) scale(0.985);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal.modal-wide {
  width: min(720px, 100%);
}

.modal.modal-preview {
  width: min(1100px, 100%);
  height: min(90vh, 920px);
  max-height: 90vh;
  background: #0b1220;
  color: #e2e8f0;
}

.modal-head {
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.modal-preview .modal-head {
  border-color: rgba(148, 163, 184, 0.2);
}

.modal-head h2 {
  font-size: 16px;
  margin: 0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-head .sub {
  color: var(--muted);
  font-size: 11.5px;
  display: block;
  margin-top: 3px;
  font-weight: 400;
}

.modal-preview .modal-head .sub {
  color: #94a3b8;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-preview .modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b1220;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex: 0 0 auto;
}

.modal-foot .left {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  flex: 0 0 auto;
}

.preview-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: auto;
}

.preview-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.preview-stage video {
  max-width: 100%;
  max-height: 100%;
  outline: none;
}

.preview-stage audio {
  width: min(560px, 88%);
}

.preview-stage pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 22px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #dbe4f0;
  background: #0b1220;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 56px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  z-index: 3;
}

.preview-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.preview-prev {
  left: 12px;
}

.preview-next {
  right: 12px;
}

.preview-empty {
  color: #94a3b8;
  text-align: center;
  padding: 40px;
}

.preview-empty .icon-slot {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  color: #64748b;
}

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 4px 0 16px;
  max-height: 220px;
  overflow: auto;
}

.upload-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.upload-row .uname {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-row .ustatus {
  color: var(--muted);
  font-size: 11.5px;
  flex: 0 0 auto;
}

.upload-row .bar {
  height: 4px;
  background: #eef2f7;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.upload-row .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s;
}

.upload-row .grow {
  flex: 1;
  min-width: 0;
}

.radio-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.radio-pill {
  position: relative;
  display: inline-flex;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pill span {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-block;
  transition: all 0.15s;
}

.radio-pill input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.share-users {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 300px;
  overflow: auto;
  margin-top: 8px;
}

.share-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

.share-user:hover {
  background: var(--panel-soft);
}

.share-user input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.share-user .su-name {
  font-size: 13.5px;
  font-weight: 600;
}

.share-user .su-sub {
  color: var(--muted);
  font-size: 11.5px;
}

.share-note {
  background: var(--panel-soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* ---------------- 用户管理 ---------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 4px 0 18px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  margin-top: 6px;
  letter-spacing: -0.4px;
}

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}

table.users {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

table.users th,
table.users td {
  text-align: left;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

table.users th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 700;
}

table.users tr:last-child td {
  border-bottom: 0;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.user-cell .uname {
  font-weight: 600;
}

.user-cell .usub {
  color: var(--muted);
  font-size: 11.5px;
}

.role-tag {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #eef2ff;
  color: #4338ca;
}

.role-tag.user {
  background: #f1f5f9;
  color: #475569;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--green);
}

.status-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-tag.off {
  color: #94a3b8;
}

.mini-bar {
  width: 92px;
  height: 6px;
  border-radius: 99px;
  background: #eef2f7;
  overflow: hidden;
  margin-top: 5px;
}

.mini-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.row-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  color: #475569;
}

.row-actions button:hover {
  background: var(--panel-soft);
}

/* ---------------- 提示/拖拽 ---------------- */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  background: #111c2e;
  color: #fff;
  border-radius: 11px;
  padding: 11px 15px;
  font-size: 13px;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.28);
  max-width: min(360px, 86vw);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease;
  line-height: 1.5;
}

.toast.error {
  background: #7f1d1d;
}

.toast.success {
  background: #064e3b;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.drop-card {
  width: min(460px, 100%);
  border: 2px dashed rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  padding: 46px 26px;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 15px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 29;
}

/* ---------------- 响应式 ---------------- */

@media (min-width: 900px) {
  .login-art {
    display: block;
  }
}

@media (max-width: 1100px) {
  .items.grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 60px rgba(2, 6, 23, 0.3);
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .mobile-bar {
    display: flex;
  }

  .main-wrap {
    width: 100%;
  }

  .topbar {
    padding: 18px 18px 12px;
  }

  .content {
    padding: 4px 18px 30px;
  }

  .title-block h1 {
    font-size: 20px;
  }

  .toolbar {
    width: 100%;
  }

  .search-box {
    flex: 1;
    min-width: 140px;
  }

  .items.list .file-body {
    gap: 10px;
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 12px;
  }

  .toolbar {
    gap: 7px;
  }

  .search-box {
    order: -1;
    flex-basis: 100%;
  }

  .items.grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
  }

  .filetype {
    width: 54px;
    height: 64px;
    font-size: 10px;
  }

  .file-body {
    padding: 9px 10px 10px;
  }

  .items.list .file-meta {
    display: none;
  }

  .items.list .file-body {
    display: block;
  }

  .items.list .file-name {
    white-space: nowrap;
  }

  .item-menu {
    opacity: 1;
  }

  .btn span:not(.icon-slot) {
    display: none;
  }

  .btn {
    padding: 9px 11px;
  }

  .login-screen {
    padding: 18px;
  }

  .login-card {
    padding: 26px 22px;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal {
    max-height: 92vh;
    border-radius: 18px 18px 12px 12px;
  }

  .modal.modal-preview {
    height: 92vh;
  }

  .toast-root {
    left: 14px;
    right: 14px;
    bottom: 14px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}
