:root {
  --bg: #f4f5fa;
  --panel: #ffffff;
  --panel-2: #fafbfe;
  --text: #1b1e2b;
  --text-2: #5b6072;
  --muted: #8b90a3;
  --border: #e7e9f2;
  --border-strong: #d8dbe8;
  --accent: #5b5bd6;
  --accent-hover: #4a4ac4;
  --accent-soft: #eeeefc;
  --danger: #e5484d;
  --danger-soft: #fdeeee;
  --success: #18a058;
  --warning: #b7791f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(27, 30, 43, 0.05);
  --shadow-md: 0 8px 28px rgba(27, 30, 43, 0.09);
  --shadow-lg: 0 24px 70px rgba(20, 22, 40, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

::selection {
  background: #d9d9ff;
}

/* ---------------- Layout ---------------- */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6b6bf0, #8b5cf6);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(91, 91, 214, 0.35);
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.btn-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(91, 91, 214, 0.25);
  transition: background 0.16s ease, transform 0.16s ease;
}

.btn-upload:hover {
  background: var(--accent-hover);
}

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

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

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item svg {
  flex: 0 0 auto;
  opacity: 0.8;
}

.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active svg {
  opacity: 1;
}

.storage-card {
  margin-top: auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.storage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 9px;
}

.storage-head strong {
  color: var(--text);
  font-weight: 600;
}

.storage-bar {
  height: 7px;
  background: #e9eaf3;
  border-radius: 99px;
  overflow: hidden;
}

.storage-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #6b6bf0, #8b5cf6);
  transition: width 0.4s ease;
}

.storage-bar.warn > span {
  background: linear-gradient(90deg, #f59e0b, #e5484d);
}

.storage-meta {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 0;
}

.sidebar-user {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.sidebar-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.icon-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}

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

.topbar {
  height: 72px;
  flex: 0 0 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
}

.breadcrumbs button {
  border: none;
  background: none;
  padding: 4px 6px;
  border-radius: 7px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumbs button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.breadcrumbs button.current {
  color: var(--text);
  font-weight: 600;
  cursor: default;
}

.breadcrumbs button.current:hover {
  background: none;
  color: var(--text);
}

.breadcrumbs .sep {
  color: #c3c6d4;
  user-select: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  position: relative;
  width: 232px;
}

.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.search input:focus {
  border-color: #b9b9f5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.12);
}

.search .clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: none;
}

.search.has-value .clear {
  display: block;
}

.search .clear:hover {
  background: var(--border);
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.btn:hover {
  border-color: #c4c7da;
  background: var(--panel-2);
}

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

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  font-weight: 600;
}

.btn.danger:hover {
  background: #cf3a3f;
  border-color: #cf3a3f;
}

.btn.ghost {
  border-color: transparent;
  background: none;
  color: var(--text-2);
}

.btn.ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.content {
  flex: 1;
  overflow: auto;
  padding: 24px 28px 90px;
}

.content-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.section-title .count {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------- File list ---------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.file-table {
  width: 100%;
}

.file-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 148px 176px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.file-head {
  height: 42px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}

.file-row {
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
  cursor: default;
}

.file-row:last-child {
  border-bottom: none;
}

.file-row:hover {
  background: #fafaff;
}

.file-row.is-folder {
  cursor: pointer;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-info {
  min-width: 0;
}

.file-title {
  font-weight: 520;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-sub {
  display: none;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size,
.file-date {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.file-row:hover .file-actions,
.file-row:focus-within .file-actions {
  opacity: 1;
}

.action-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.action-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.action-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.action-btn[data-tip] {
  position: relative;
}

.action-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2d3d;
  color: #fff;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
}

/* 文件类型图标 */
.ficon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #eef0f8;
  color: #5b6072;
  position: relative;
  overflow: hidden;
}

.ficon svg {
  width: 21px;
  height: 21px;
}

.ficon.folder {
  background: #fff5da;
  color: #d99a08;
}

.ficon.image {
  background: #e7f7ee;
  color: #18a058;
}

.ficon.video {
  background: #fdecef;
  color: #e5484d;
}

.ficon.audio {
  background: #ede9fe;
  color: #7c3aed;
}

.ficon.document {
  background: #e8f1fe;
  color: #2563eb;
}

.ficon.archive {
  background: #fef3e2;
  color: #b7791f;
}

.ficon.thumb {
  background: #f1f2f8;
}

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

/* 空状态 */
.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px dashed var(--border-strong);
  display: grid;
  place-items: center;
  color: #b7bacb;
}

.empty h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--text-2);
  font-weight: 600;
}

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

/* ---------------- 上传抽屉 ---------------- */

.upload-drawer {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 372px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 40;
  display: flex;
  flex-direction: column;
  max-height: 56vh;
}

.upload-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13.5px;
}

.upload-head .sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.upload-head .spacer {
  flex: 1;
}

.upload-list {
  overflow: auto;
  padding: 6px 0;
}

.upload-item {
  padding: 9px 16px;
}

.upload-item + .upload-item {
  border-top: 1px solid var(--border);
}

.upload-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.upload-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.upload-item-status {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.upload-item-status.error {
  color: var(--danger);
}

.upload-item-status.done {
  color: var(--success);
}

.progress {
  margin-top: 7px;
  height: 5px;
  background: #eef0f7;
  border-radius: 99px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6b6bf0, #8b5cf6);
  border-radius: 99px;
  transition: width 0.18s linear;
}

.progress.error > span {
  background: var(--danger);
}

/* ---------------- 弹窗 ---------------- */

.modal-root:empty {
  display: none;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 38, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
  animation: fade 0.16s ease;
}

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

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

.modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: pop 0.18s ease;
  overflow: hidden;
}

.modal.preview {
  max-width: 1020px;
  height: calc(100vh - 64px);
  max-height: 900px;
}

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

.modal-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.modal.preview .modal-body {
  padding: 0;
  flex: 1;
  min-height: 0;
  background: #f7f8fc;
  display: flex;
  flex-direction: column;
}

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

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input:focus {
  border-color: #b9b9f5;
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.12);
}

textarea.input {
  height: auto;
  min-height: 90px;
  padding: 10px 12px;
  resize: vertical;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b90a3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > .field {
  flex: 1;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}

.check input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.share-link-box .input {
  flex: 1;
  font-size: 12.5px;
  background: var(--panel-2);
}

.share-result {
  background: #f6f7ff;
  border: 1px solid #dfe0fb;
  border-radius: 12px;
  padding: 14px;
  margin-top: 4px;
}

.share-result .label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.share-result .meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
}

.tag.gray {
  background: #f1f2f7;
  color: var(--text-2);
}

.tag.red {
  background: var(--danger-soft);
  color: var(--danger);
}

/* 预览 */
.preview-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0;
}

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

.preview-stage video {
  max-width: 100%;
  max-height: 100%;
  background: #000;
  border-radius: 0;
}

.preview-audio {
  width: 100%;
  padding: 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
}

.preview-audio audio {
  width: min(520px, 100%);
}

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

.preview-text {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 22px 26px;
  overflow: auto;
  background: #fff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #24292f;
}

.preview-none {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-2);
}

.preview-none .big {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: #a7aabc;
}

.preview-none h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text);
}

.preview-none p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  max-width: 380px;
}

.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  padding: 60px;
  width: 100%;
}

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

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

/* ---------------- Toast ---------------- */

.toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 11px;
  background: #242736;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease;
  max-width: min(480px, calc(100vw - 32px));
}

.toast.success svg { color: #4ade80; }
.toast.error svg { color: #ff8b8f; }
.toast.out { animation: toast-out 0.2s ease forwards; }

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

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* ---------------- 拖拽上传 ---------------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(91, 91, 214, 0.12);
  backdrop-filter: blur(2px);
  border: 3px dashed rgba(91, 91, 214, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay.show {
  display: flex;
}

.drop-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px 34px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------------- 分享管理 ---------------- */

.share-list {
  display: flex;
  flex-direction: column;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.share-row:last-child {
  border-bottom: none;
}

.share-main {
  flex: 1;
  min-width: 0;
}

.share-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 550;
  min-width: 0;
}

.share-name span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-url {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.share-stats b {
  color: var(--text-2);
  font-weight: 600;
}

.share-actions {
  display: flex;
  gap: 4px;
}

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

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 520px at 15% -10%, #e7e7ff 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #eaf3ff 0%, transparent 55%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 22px;
  padding: 36px 34px 30px;
  box-shadow: 0 24px 80px rgba(43, 45, 75, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6b6bf0, #8b5cf6);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 12px 26px rgba(91, 91, 214, 0.35);
  margin-bottom: 14px;
}

.auth-brand h1 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

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

.auth-form .field label {
  font-size: 12.5px;
}

.auth-error {
  display: none;
  margin-bottom: 14px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}

.auth-error.show {
  display: block;
}

.auth-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(91, 91, 214, 0.26);
  transition: background 0.16s ease;
}

.auth-submit:hover {
  background: var(--accent-hover);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

/* 右键菜单 */
.menu {
  position: fixed;
  z-index: 90;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  padding: 5px;
  animation: pop 0.14s ease;
}

.menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.menu button:hover {
  background: var(--panel-2);
  color: var(--text);
}

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

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

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

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 11px;
  background: #fff8e6;
  border: 1px solid #f5e3b3;
  color: #8a6410;
  font-size: 12.5px;
  margin-bottom: 18px;
}

.banner button {
  margin-left: auto;
  border: none;
  background: none;
  color: #8a6410;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.banner button:hover {
  background: #f9edc9;
}

@media (max-width: 1080px) {
  .file-head,
  .file-row {
    grid-template-columns: minmax(0, 1fr) 150px;
  }
  .file-head .col-size,
  .file-row .file-size,
  .file-head .col-date,
  .file-row .file-date {
    display: none;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 55;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: none;
  }
  .mobile-menu {
    display: inline-grid !important;
  }
  .topbar {
    padding: 0 16px;
    gap: 8px;
  }
  .content {
    padding: 16px 16px 90px;
  }
  .search {
    width: 150px;
  }
  .btn-new-folder-text {
    display: none;
  }
  .file-head {
    display: none;
  }
  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 14px;
    gap: 8px;
  }
  .file-size,
  .file-date {
    display: none !important;
  }
  .file-sub {
    display: block;
  }
  .file-actions {
    opacity: 1;
  }
  .action-btn.hide-mobile {
    display: none;
  }
  .share-stats {
    display: none;
  }
  .upload-drawer {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 12px;
  }
}

.mobile-menu {
  display: none;
}

@media (max-width: 560px) {
  .topbar-actions .btn-new-folder {
    width: 38px;
    padding: 0;
  }
  .search {
    display: none;
  }
  .modal-mask {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }
  .modal.preview {
    height: 92vh;
    max-height: none;
    border-radius: 18px 18px 0 0;
  }
}
