/* =========================================================================
   轻盘 · 界面样式
   直角简约：中性灰表面 + 1px 描边 + 2px 圆角，强调色只在关键操作上出现
   ========================================================================= */

:root {
  color-scheme: light;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f3f4;
  --hover: rgba(60, 64, 67, 0.06);
  --active: rgba(60, 64, 67, 0.1);

  --line: #e0e3e7;
  --line-strong: #c9ced6;

  --text: #1f2328;
  --text-2: #5f6368;
  --text-3: #8b9198;

  --accent: #1a73e8;
  --accent-hover: #1765cc;
  --accent-soft: #e8f0fe;
  --accent-line: #c6dafc;

  --danger: #d93025;
  --danger-soft: #fce8e6;
  --ok: #188038;
  --ok-soft: #e6f4ea;
  --warn: #9a6700;
  --warn-soft: #fef7e0;

  --radius: 2px;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, 0.08), 0 1px 3px rgba(60, 64, 67, 0.06);
  --shadow-2: 0 6px 18px rgba(60, 64, 67, 0.14), 0 2px 6px rgba(60, 64, 67, 0.08);

  --font: "Segoe UI", "Roboto", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui,
    -apple-system, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sidebar-w: 236px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #1b1b1b;
    --surface: #242424;
    --surface-2: #2b2b2b;
    --surface-3: #323232;
    --hover: rgba(255, 255, 255, 0.06);
    --active: rgba(255, 255, 255, 0.1);

    --line: #3a3a3a;
    --line-strong: #4a4a4a;

    --text: #e6e6e6;
    --text-2: #b0b4b9;
    --text-3: #868b91;

    --accent: #8ab4f8;
    --accent-hover: #a4c5f9;
    --accent-soft: rgba(138, 180, 248, 0.14);
    --accent-line: rgba(138, 180, 248, 0.32);

    --danger: #f28b82;
    --danger-soft: rgba(242, 139, 130, 0.14);
    --ok: #81c995;
    --ok-soft: rgba(129, 201, 149, 0.14);
    --warn: #fdd663;
    --warn-soft: rgba(253, 214, 99, 0.14);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 10px 26px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

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

a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid var(--bg);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  text-decoration: none;
}
.btn:active {
  background: var(--active);
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
@media (prefers-color-scheme: dark) {
  .btn.primary {
    color: #1b1b1b;
    font-weight: 500;
  }
}
.btn.danger {
  color: var(--danger);
  border-color: var(--line);
}
.btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  background: var(--hover);
  border-color: transparent;
}
.btn.icon {
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn.icon:hover {
  background: var(--hover);
  color: var(--text);
}
.btn.icon svg {
  width: 16px;
  height: 16px;
}
.btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ 表单 */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.input,
.select,
.textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-strong);
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}
.textarea {
  height: auto;
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.6;
}
.select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.65;
}
.hint b {
  color: var(--text-2);
  font-weight: 500;
}
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  transition: background 0.14s ease, border-color 0.14s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-3);
  transition: transform 0.14s ease, background 0.14s ease;
}
.switch[aria-checked="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.switch[aria-checked="true"]::after {
  transform: translateX(16px);
  background: var(--accent);
}

/* 分段控件 */
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.seg-item {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  color: var(--text-2);
  border-right: 1px solid var(--line);
  transition: background 0.12s ease, color 0.12s ease;
}
.seg-item:last-child {
  border-right: none;
}
.seg-item:hover {
  background: var(--hover);
}
.seg-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

/* ------------------------------------------------------------------ 启动加载 */
.view-boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.boot-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 32px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
}
@keyframes boot-spin {
  to { transform: rotate(360deg); }
}
.boot-text {
  font-size: 14px;
  color: var(--text-2);
}
.boot-card.error .spinner {
  display: none;
}
.boot-card.error .boot-text {
  color: var(--danger);
}

/* ------------------------------------------------------------------ 登录 */
.view-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: min(380px, 100%);
  padding: 32px 32px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.brand-mark svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}
@media (prefers-color-scheme: dark) {
  .brand-mark svg {
    stroke: #1b1b1b;
  }
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.1px;
}
.login-card .sub {
  margin: 0 0 24px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-error {
  min-height: 16px;
  font-size: 12px;
  color: var(--danger);
}
.login-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-3);
}

/* ------------------------------------------------------------------ 布局 */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background: var(--bg);
}
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 14px 0 0;
  overflow: hidden;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 16px;
}
.side-brand .mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius);
  flex: none;
}
.side-brand .mark svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
}
@media (prefers-color-scheme: dark) {
  .side-brand .mark svg {
    stroke: #1b1b1b;
  }
}
.side-brand .name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-brand .desc {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.nav-group {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  gap: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.side-foot {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.8;
}
.side-foot b {
  color: var(--text-2);
  font-weight: 500;
  word-break: break-all;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  background: var(--bg);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  flex: none;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.crumb {
  padding: 4px 6px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb:hover {
  background: var(--hover);
  color: var(--text);
}
.crumb.current {
  color: var(--text);
  font-weight: 500;
}
.crumb-sep {
  color: var(--text-3);
  font-size: 12px;
  user-select: none;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.search {
  position: relative;
  width: 200px;
}
.search input {
  height: 30px;
  padding-left: 30px;
  background: var(--surface-3);
  border-color: transparent;
}
.search input:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.search svg {
  position: absolute;
  left: 9px;
  top: 8px;
  width: 14px;
  height: 14px;
  stroke: var(--text-3);
  pointer-events: none;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  flex: none;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.toolbar .spacer {
  flex: 1;
}
.count {
  font-size: 12px;
  color: var(--text-3);
}

.content {
  flex: 1;
  overflow: auto;
  padding: 0 8px 48px;
  position: relative;
}

.notice {
  margin: 12px 12px 4px;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--text-2);
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ 文件表 */
.file-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 128px 168px;
  align-items: center;
  gap: 10px;
}
.file-head {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 38px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.file-row {
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid transparent;
  border-radius: var(--radius);
  cursor: default;
  transition: background 0.1s ease;
}
.file-row:hover {
  background: var(--hover);
}
.file-row + .file-row {
  box-shadow: inset 0 1px 0 var(--line);
}
.file-row:hover + .file-row {
  box-shadow: none;
}
.file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.file-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: var(--radius);
}
.file-icon svg {
  width: 17px;
  height: 17px;
}
.file-title {
  min-width: 0;
}
.file-title .n {
  display: block;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row.dir .file-title .n {
  font-weight: 500;
}
.file-title .m {
  display: none;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 1px;
}
.cell {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.file-row:hover .row-actions,
.file-row:focus-within .row-actions {
  opacity: 1;
}

/* 骨架屏 */
.file-row.skeleton {
  pointer-events: none;
}
.file-row.skeleton .file-icon {
  background: var(--surface-3);
}
.file-row.skeleton .n {
  height: 9px;
  border-radius: 1px;
  background: var(--surface-3);
}

.empty {
  display: grid;
  place-items: center;
  padding: 88px 20px;
  text-align: center;
}
.empty .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-3);
}
.empty .icon svg {
  width: 26px;
  height: 26px;
}
.empty h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.empty p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.7;
}

/* 拖拽遮罩 */
.dropzone-overlay {
  position: fixed;
  inset: 12px;
  z-index: 40;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

/* ------------------------------------------------------------------ 上传队列 */
.uploads {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 320px;
  z-index: 45;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.uploads header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface-2);
}
.uploads header .spacer {
  flex: 1;
}
.uploads .list {
  max-height: 220px;
  overflow: auto;
  padding: 4px;
}
.up-item {
  padding: 8px 8px 9px;
  border-radius: var(--radius);
}
.up-item:hover {
  background: var(--hover);
}
.up-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
}
.up-line .nm {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.up-line .pct {
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.bar {
  height: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.18s linear;
}
.up-item.done .bar > i {
  background: var(--ok);
}
.up-item.error .bar > i {
  background: var(--danger);
}
.up-item .err {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--danger);
  word-break: break-all;
}

/* ------------------------------------------------------------------ 弹层 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(32, 33, 36, 0.4);
}
@media (prefers-color-scheme: dark) {
  .modal {
    background: rgba(0, 0, 0, 0.6);
  }
}
.modal-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.modal-card.wide {
  width: min(640px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 0;
}
.modal-head h2 {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px 6px;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 18px;
}
.modal-foot .spacer {
  flex: 1;
}

.link-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 3px 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.link-box input {
  flex: 1;
  min-width: 0;
  height: 28px;
  border: none;
  background: none;
  outline: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}
.share-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  white-space: nowrap;
}
.tag.ok {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}
.tag.warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}
.tag.bad {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}
.tag.blue {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

/* ------------------------------------------------------------------ 分享列表 */
.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 10px;
  padding: 16px 10px;
}
.share-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.share-card:hover {
  border-color: var(--line-strong);
}
.share-card .top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.share-card .nm {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-card .sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
}
.share-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.share-card .acts {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ 设置 */
.settings-wrap {
  max-width: 700px;
  padding: 16px 10px 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
}
.card > h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
}
.card > .desc {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
}
.card code {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 4px;
  background: var(--surface-3);
  border-radius: 1px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.row-between + .row-between {
  border-top: 1px solid var(--line);
}
.row-between .t {
  font-size: 13px;
}
.row-between .d {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--text-3);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat .v {
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.stat .k {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ------------------------------------------------------------------ 分享页 */
.view-share {
  min-height: 100vh;
  overflow: auto;
  padding: 40px 20px 60px;
  background: var(--bg);
}
.share-wrap {
  max-width: 960px;
  margin: 0 auto;
}
.share-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.share-head .mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius);
}
.share-head .mark svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}
@media (prefers-color-scheme: dark) {
  .share-head .mark svg {
    stroke: #1b1b1b;
  }
}
.share-head .t {
  font-size: 13px;
  font-weight: 500;
}
.share-head .s {
  font-size: 11.5px;
  color: var(--text-3);
}
.share-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.share-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.share-file .meta {
  flex: 1;
  min-width: 0;
}
.share-file .nm {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-file .sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}
.share-preview {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--surface-2);
}
.share-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.share-error {
  padding: 64px 24px;
  text-align: center;
}
.share-error .ic {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
}
.share-error .ic svg {
  width: 24px;
  height: 24px;
}
.share-error h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 500;
}
.share-error p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.share-lock {
  max-width: 340px;
  margin: 0 auto;
  padding: 44px 24px;
  text-align: center;
}
.share-lock .ic {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
}
.share-lock .ic svg {
  width: 22px;
  height: 22px;
}
.share-lock h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
}
.share-lock p {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--text-3);
}
.share-lock form {
  display: flex;
  gap: 6px;
}

/* ------------------------------------------------------------------ 预览 */
.preview {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  flex: none;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.preview-bar .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}
.preview-bar .nm small {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-3);
}
.preview-body {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
  position: relative;
  background: var(--bg);
}
.preview-body img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: zoom-in;
}
.preview-body img.zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
.preview-body video {
  max-width: min(100%, 1100px);
  max-height: calc(100vh - 120px);
  background: #000;
  outline: none;
}
.preview-body iframe {
  width: 100%;
  height: calc(100vh - 116px);
  border: 1px solid var(--line);
  background: #fff;
}
.audio-wrap {
  width: min(520px, 100%);
  text-align: center;
}
.audio-name {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-2);
}
.audio-wrap audio {
  width: 100%;
}
.preview-body pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  tab-size: 2;
  white-space: pre;
}
.preview-body pre.preview-loading {
  color: var(--text-3);
  height: auto;
}
.preview-body .md {
  width: 100%;
  max-width: 820px;
  height: 100%;
  overflow: auto;
  padding: 28px 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.8;
}
.preview-body .md h1,
.preview-body .md h2,
.preview-body .md h3,
.preview-body .md h4 {
  margin: 1.4em 0 0.5em;
  font-weight: 500;
  line-height: 1.4;
}
.preview-body .md h1 {
  margin-top: 0;
  font-size: 1.6em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
}
.preview-body .md h2 {
  font-size: 1.3em;
}
.preview-body .md h3 {
  font-size: 1.1em;
}
.preview-body .md p {
  margin: 0.7em 0;
}
.preview-body .md code {
  padding: 1px 4px;
  background: var(--surface-3);
  font-family: var(--mono);
  font-size: 0.88em;
}
.preview-body .md pre {
  height: auto;
  margin: 0.9em 0;
  padding: 12px 14px;
  background: var(--surface-2);
  overflow: auto;
}
.preview-body .md pre code {
  padding: 0;
  background: none;
}
.preview-body .md blockquote {
  margin: 0.9em 0;
  padding: 2px 14px;
  border-left: 3px solid var(--line-strong);
  color: var(--text-2);
}
.preview-body .md table {
  border-collapse: collapse;
  margin: 0.9em 0;
  font-size: 12.5px;
}
.preview-body .md th,
.preview-body .md td {
  padding: 6px 10px;
  border: 1px solid var(--line);
  text-align: left;
}
.preview-body .md th {
  background: var(--surface-2);
  font-weight: 500;
}
.preview-body .md img {
  max-width: 100%;
}
.preview-body .md hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.4em 0;
}
.preview-fallback {
  max-width: 360px;
  text-align: center;
}
.preview-fallback .ic {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.preview-fallback .ic svg {
  width: 28px;
  height: 28px;
}
.preview-fallback h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
}
.preview-fallback p {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.7;
}
.preview-note {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--text-2);
  box-shadow: var(--shadow-1);
}

/* ------------------------------------------------------------------ Toast */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  max-width: 460px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--text-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  color: var(--text);
  animation: toastIn 0.16s ease;
}
.toast.ok {
  border-left-color: var(--ok);
}
.toast.bad {
  border-left-color: var(--danger);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1080px) {
  .file-head,
  .file-row {
    grid-template-columns: minmax(0, 1fr) 96px 150px;
  }
  .col-time {
    display: none;
  }
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow-2);
  }
  .sidebar.open {
    transform: none;
  }
  .file-head {
    display: none;
  }
  .file-row {
    height: auto;
    min-height: 54px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 10px;
  }
  .file-row .cell {
    display: none;
  }
  .file-title .m {
    display: block;
  }
  .row-actions {
    opacity: 1;
  }
  .search {
    width: 120px;
  }
  .topbar {
    padding: 0 12px;
  }
  .toolbar {
    padding: 0 12px;
  }
  .content {
    padding: 0 6px 40px;
  }
  .uploads {
    left: 10px;
    right: 10px;
    width: auto;
  }
  .stat-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .share-file {
    flex-wrap: wrap;
  }
  .view-share {
    padding: 20px 12px 40px;
  }
}
