:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: #ffffff;
  --text: #14212b;
  --muted: #66727f;
  --line: #d7dfe6;
  --brand: #d93a49;
  --brand-soft: rgba(217, 58, 73, 0.1);
  --danger: #c53030;
  --shadow: 0 18px 50px rgba(20, 33, 43, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 58, 73, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(24, 144, 255, 0.09), transparent 22%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 20px 14px 28px;
}

.screen {
  display: block;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 16px;
}

.stack {
  display: grid;
  gap: 12px;
}

.topbar,
.toolbar,
.zone-tabs {
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.12;
}

.muted {
  color: var(--muted);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-inline {
  width: 100%;
}

.field span {
  font-size: 13px;
  color: var(--muted);
}

input[type="password"],
input[type="text"],
select {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 14px;
  color: var(--text);
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 14px;
}

.primary-button {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.ghost-button,
.tiny-button {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  background: var(--danger);
  color: #fff;
  font-weight: 700;
}

.tiny-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.error-text {
  margin: 0;
  color: var(--danger);
}

.tab-list {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-button {
  min-height: 40px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.tab-button.active {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.path-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 33, 43, 0.08);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.crumb-button {
  background: transparent;
  border: 0;
  padding: 0;
  min-height: auto;
  color: var(--brand);
}

.path-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-row + .toolbar-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 33, 43, 0.08);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

.file-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.file-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(20, 33, 43, 0.08);
  border-radius: 16px;
  background: var(--card-strong);
}

.file-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
}

.file-card-main {
  cursor: pointer;
}

.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.file-name {
  font-size: 16px;
  font-weight: 700;
  word-break: break-all;
}

.file-subline,
.file-path {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subtle-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20, 33, 43, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.file-actions button {
  min-height: 34px;
  font-size: 13px;
  border-radius: 12px;
}

.file-check {
  inline-size: 22px;
  block-size: 22px;
  margin-top: 10px;
  accent-color: var(--brand);
}

.file-card.batch-mode {
  border-color: rgba(217, 58, 73, 0.2);
}

.file-card.batch-selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(217, 58, 73, 0.18);
}

.upload-item {
  display: grid;
  gap: 6px;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 33, 43, 0.08);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ec6c78, var(--brand));
}

.empty-state {
  padding: 28px 10px;
  text-align: center;
  color: var(--muted);
}

.dialog {
  width: min(760px, calc(100vw - 24px));
  border: 0;
  border-radius: 22px;
  padding: 0;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(11, 20, 26, 0.45);
}

.dialog-head,
#move-form {
  padding: 18px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid rgba(20, 33, 43, 0.08);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.preview-body {
  padding: 18px;
  max-height: 72vh;
  overflow: auto;
}

.preview-body img {
  display: block;
  max-width: 100%;
  border-radius: 16px;
}

.preview-body iframe {
  width: 100%;
  min-height: 70vh;
  border: 0;
  border-radius: 16px;
}

.preview-text {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
}

@media (min-width: 900px) {
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: start;
  }

  .file-card-head {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .file-actions {
    justify-content: flex-end;
  }
}
