:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #059669;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 500px at 50% -120px, #e8eeff 0%, var(--bg) 60%);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 26px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .2px;
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #4f8bff);
  display: grid; place-items: center;
  color: #fff; font-size: 14px; font-weight: 700;
}

.login-card h1 { font-size: 20px; margin: 22px 0 4px; }
.login-card p.hint { color: var(--muted); margin: 0 0 20px; font-size: 13px; }

label.field { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type="password"], input[type="text"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input[type="password"]:focus, input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}

.btn:hover { background: #fafafa; border-color: #d5d8de; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4fd7; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f3f4f6; color: var(--text); }
.btn.danger { color: var(--danger); border-color: #f3d2d2; background: #fff7f7; }
.btn.danger:hover { background: #ffecec; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

.login-card .btn.primary { width: 100%; height: 42px; margin-top: 18px; font-size: 14.5px; }
.error {
  color: var(--danger);
  font-size: 13px;
  margin: 12px 0 0;
  background: #fff5f5;
  border: 1px solid #f7dcdc;
  padding: 8px 10px;
  border-radius: 8px;
}

/* ---------- 主页面 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar .spacer { flex: 1; }
.topbar .meta { color: var(--muted); font-size: 12.5px; }

.container { max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; }

.dropzone {
  background: var(--card);
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  padding: 34px 24px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}

.dropzone:hover { border-color: #94a3b8; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }

.dropzone .icon {
  width: 46px; height: 46px; margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid; place-items: center;
  color: var(--accent);
}

.dropzone h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.dropzone p { margin: 0; color: var(--muted); font-size: 13px; }

.upload-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

.upload-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  font-size: 13px;
}

.upload-item .bar {
  grid-column: 1 / -1;
  height: 4px;
  background: #eef0f3;
  border-radius: 99px;
  overflow: hidden;
}

.upload-item .bar > i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width .12s linear;
}

.upload-item.done .bar > i { background: var(--ok); }
.upload-item.fail .bar > i { background: var(--danger); }

.toolbar {
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar h2 { margin: 0; font-size: 15px; font-weight: 600; }
.toolbar .count { color: var(--muted); font-size: 12.5px; }

.search {
  margin-left: auto;
  position: relative;
}

.search input {
  width: 240px;
  height: 34px;
  padding: 0 12px 0 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  outline: none;
}

.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search svg { position: absolute; left: 10px; top: 9px; color: #9ca3af; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, border-color .15s;
}

.card:hover { box-shadow: var(--shadow); border-color: #d8dce3; }

.thumb {
  height: 132px;
  background: #f2f4f7;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .filetype {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #8a93a2; font-size: 11px; letter-spacing: .4px;
}

.thumb .badge {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(17, 24, 39, .72);
  color: #fff; font-size: 10.5px;
  padding: 2px 7px; border-radius: 99px;
  backdrop-filter: blur(4px);
}

.card-body { padding: 10px 12px 6px; }
.card-title {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }

.card-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px 12px;
  flex-wrap: wrap;
}

.empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }

.toast {
  position: fixed;
  left: 50%; bottom: 32px;
  transform: translate(-50%, 20px);
  background: #111827;
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .container { padding: 16px 14px 48px; }
  .topbar-inner { padding: 0 14px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .thumb { height: 108px; }
}
