:root {
  --ink: #1c2430;
  --muted: #6b7280;
  --paper: #eef1f4;
  --card: #ffffff;
  --line: #e4e8ee;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #e7f5f3;
  --danger: #b42318;
  --ok: #067647;
  --shadow: 0 8px 24px rgba(22, 32, 48, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 280px at 10% -10%, #d9efe9 0%, transparent 60%),
    var(--paper);
  font: 14px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--teal-dark); }
button, input, select { font: inherit; }

.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  height: 60px;
  background: #121820;
  color: #f4f7fb;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: 0.06em;
}
.top nav { display: flex; gap: 6px; flex: 1; }
.top nav a {
  color: #c9d3de;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
}
.top nav a.active,
.top nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; color: #d7dee7; }
.who span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link, button.link {
  background: none;
  border: 0;
  color: #f2c14e;
  cursor: pointer;
  padding: 0;
}

.wrap { width: min(1120px, calc(100% - 28px)); margin: 22px auto 48px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; margin: 0; width: auto; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.03em; }
.page-head p { margin: 4px 0 0; }
.head-stats { display: flex; gap: 8px; }
.head-stats span {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.head-stats b { color: var(--ink); margin-right: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.auth-card { width: min(420px, 100%); padding: 28px; }
.narrow { width: min(460px, 100%); }
h1, h2 { margin: 0 0 8px; }
.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--teal);
  font-weight: 700;
}
.muted, .hint { color: var(--muted); }
.hint { font-size: 12px; }
.foot { margin: 16px 0 0; }

label { display: block; margin: 12px 0; color: var(--muted); font-size: 13px; }
input, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--teal);
}
button, .btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ink);
}
button:hover, .btn:hover { border-color: #cfd6df; }
.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 650;
}
.primary:hover { background: var(--teal-dark); }
.primary:disabled { opacity: 0.65; cursor: wait; }
.danger {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
  padding: 4px 8px;
}
.danger:hover { background: #fef3f2; }

.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.flash.ok { background: #e8f6ee; color: var(--ok); }
.flash.error { background: #fdecea; color: var(--danger); }

.drop {
  background: var(--card);
  border: 1.5px dashed #b7c9c6;
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.drop.over { border-color: var(--teal); background: var(--teal-soft); }
.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pick {
  position: relative;
  flex: 1;
  margin: 0;
  min-height: 72px;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--ink);
}
.pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.pick-title { display: block; font-size: 16px; font-weight: 700; }
#file-label { color: var(--muted); }
.progress { height: 6px; margin: 0 16px 8px; background: #e7eceb; border-radius: 99px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--teal); }
#progress-text { margin: 0 16px 10px; min-height: 0; }
#progress-text:empty { display: none; }

.table-card { padding: 0; overflow: hidden; }
.table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.table-head h2 { margin: 0; font-size: 16px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { display: flex; gap: 8px; }
.search input { width: 200px; margin: 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  background: #fbfcfd;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7fbfa; }
.name { font-weight: 650; word-break: break-all; }
.size, .time { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.links { display: flex; gap: 6px; }
.links a, .copy, .tip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  text-decoration: none;
}
.links a:hover, .copy:hover { border-color: var(--teal); color: var(--teal-dark); }
.tip {
  color: #9a6700;
  border-color: #f5d08a;
  background: #fff8eb;
  cursor: pointer;
}
.batch-list {
  list-style: none;
  margin: 0 16px 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.batch-list li {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  background: #f7faf9;
}
.batch-list li.ok { color: var(--ok); background: #eef8f1; }
.batch-list li.err { color: var(--danger); background: #fdecea; }
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.table-head h2 .muted { font-weight: 500; font-size: 13px; margin-left: 8px; }
.empty { color: var(--muted); text-align: center; padding: 36px 16px; }

.ops { display: flex; flex-direction: column; gap: 8px; }
.ops form, .grid { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.ops input, .grid input, .grid select { width: 150px; margin: 0; }
.grid label { margin: 0; }

@media (max-width: 800px) {
  .top { height: auto; padding: 12px; flex-wrap: wrap; }
  .page-head, .upload-row, .table-head { flex-direction: column; align-items: stretch; }
  .search input, .ops input, .grid input, .grid select { width: 100%; }
  .primary { width: 100%; padding: 12px; }
}
