:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #1b2430;
  --ink-soft: #5b6775;
  --line: #e3e9f0;
  --brand: #2563eb;
  --brand-2: #06b6d4;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --shadow: 0 6px 24px rgba(20, 40, 80, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 210px;
}

.hero {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #fff;
  border-radius: 18px;
  padding: 30px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: 0.5px;
}

.hero p {
  margin: 0;
  opacity: 0.92;
  font-size: 14px;
}

.hero .badge {
  display: inline-block;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: 0.4px;
}

.group {
  margin-bottom: 26px;
}

.group-head {
  margin-bottom: 12px;
  padding-left: 4px;
  border-left: 4px solid var(--brand);
}

.group-head h2 {
  margin: 0;
  font-size: 18px;
}

.group-desc {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(20, 40, 80, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.card-info { flex: 1 1 auto; min-width: 0; }

.card-label {
  font-weight: 600;
  font-size: 15px;
}

.card-hint {
  color: var(--ink-soft);
  font-size: 12.5px;
  margin-top: 2px;
}

.card-file {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-file .btn-primary { margin-left: auto; }

/* one upload entry ("slot") inside a card */
.slots { margin-top: 4px; }

.slot {
  padding: 12px 0 2px;
  border-top: 1px dashed var(--line);
}

.slot:first-child { border-top: none; padding-top: 8px; }

.slot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.slot-label { font-weight: 600; font-size: 14px; color: var(--ink); }

.slot-optional {
  font-size: 11px;
  color: #8b98a9;
  background: #f1f4f9;
  border: 1px solid #e3e9f0;
  border-radius: 999px;
  padding: 1px 8px;
}

.slot-badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}

.slot-badge.is-idle {
  background: #f1f4f9;
  color: #8b98a9;
  border: 1px solid #e3e9f0;
}

.slot-badge.is-done {
  background: #e8f8ee;
  color: var(--ok);
  border: 1px solid #bfe8cd;
}

.file-name {
  color: #94a1b2;
  font-size: 12.5px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name.has-file { color: var(--ink); font-weight: 500; }

.card-right {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.card-status {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: left;
  min-height: 16px;
  margin-top: 6px;
}

.st-idle { color: #94a1b2; }
.st-uploading { color: var(--brand); }
.st-done { color: var(--ok); font-weight: 600; }
.st-error { color: var(--err); font-weight: 600; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

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

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

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #1d4ed8, #1e40af); }

.btn-ghost {
  background: #eef3fb;
  color: var(--brand);
  border: 1px solid #d7e3fb;
}

.btn-ghost:hover:not(:disabled) { background: #e2ecfc; }

.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }

.mini-bar {
  height: 6px;
  background: #edf1f7;
  border-radius: 999px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  transition: width 0.25s ease;
}

.mini-fill.done { background: linear-gradient(90deg, #16a34a, #22c55e); }

/* Fixed bottom total progress panel */
.total-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(20, 40, 80, 0.08);
  padding: 14px 20px 18px;
  z-index: 50;
}

.total-inner {
  max-width: 960px;
  margin: 0 auto;
}

.total-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.total-title {
  font-weight: 700;
  font-size: 15px;
}

.total-pct {
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.total-bar {
  position: relative;
  height: 16px;
  background: #e8eef7;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(20, 40, 80, 0.08);
}

.total-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #2563eb);
  background-size: 200% 100%;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  animation: flow 2.4s linear infinite;
}

.total-fill.complete {
  background: linear-gradient(90deg, #16a34a, #22c55e, #16a34a);
  background-size: 200% 100%;
}

/* moving sheen on top of the fill */
.total-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-100%);
  animation: sheen 1.6s ease-in-out infinite;
}

@keyframes flow {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

@keyframes sheen {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.total-meta {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.total-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.global-status {
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 4px;
}

.global-status.ok { color: var(--ok); font-weight: 600; }
.global-status.warn { color: var(--warn); font-weight: 600; }
.global-status.busy { color: var(--brand); font-weight: 600; }

.footer-note {
  text-align: center;
  color: #9aa6b5;
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .card { flex-direction: column; align-items: stretch; }
  .card-right { flex: 1 1 auto; }
  .hero { padding: 24px 22px; }
  .hero h1 { font-size: 22px; }
}

/* ---- 授权码解锁条 ---- */
.authbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(20, 40, 80, 0.04);
}

.authbar-text { display: flex; flex-direction: column; min-width: 0; }
.authbar-text strong { font-size: 14.5px; }
.authbar-text span { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.authbar-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.code-input {
  border: 1px solid #d7e3fb;
  background: #f5f8fe;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  width: 170px;
  color: var(--ink);
  letter-spacing: 2px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.code-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.auth-state { font-size: 12.5px; color: var(--ink-soft); min-width: 0; }
.auth-state.ok { color: var(--ok); font-weight: 600; }
.auth-state.warn { color: var(--warn); font-weight: 600; }
.auth-state.err { color: var(--err); font-weight: 600; }
.auth-state.busy { color: var(--brand); font-weight: 600; }

/* ---- 卡片：状态徽章 + 已上传文件列表 ---- */
.card-main { flex: 1 1 auto; min-width: 0; }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-badge {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.card-badge.is-idle {
  background: #f1f4f9;
  color: #8b98a9;
  border: 1px solid #e3e9f0;
}

.card-badge.is-done {
  background: #e8f8ee;
  color: var(--ok);
  border: 1px solid #bfe8cd;
}

.card-badge.is-part {
  background: #fff5e6;
  color: #b45309;
  border: 1px solid #fde3bf;
}

.card.is-complete { border-color: #c7e9d5; }

.card.has-upload { border-color: #cfe8d9; }

.group-count {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-left: auto;
}

.group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.up-files {
  margin-top: 10px;
  border: 1px dashed #cfe0f8;
  background: #f8fbff;
  border-radius: 10px;
  padding: 6px 10px;
}

.up-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 2px;
  border-bottom: 1px solid #eaf1fb;
}

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

.up-file-meta { display: flex; flex-direction: column; min-width: 0; }

.up-file-name {
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}

.up-file-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 1px; }

.up-file-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }


/* ---- 手机版增强 ---- */
@media (max-width: 640px) {
  html, body { -webkit-text-size-adjust: 100%; }
  .wrap { padding: 16px 12px 230px; }
  .hero { padding: 22px 18px; border-radius: 14px; margin-bottom: 18px; }
  .hero h1 { font-size: 20px; line-height: 1.3; }
  .hero p { font-size: 13px; }
  .hero .badge { margin-top: 10px; }
  .group { margin-bottom: 18px; }
  .group-head h2 { font-size: 16px; }
  .card { padding: 14px; border-radius: 12px; }
  .card-file .btn-primary { margin-left: 0; flex: 1 1 100%; }
  .card-file .file-name { max-width: 100%; flex: 1 1 100%; }
  .slot { padding: 10px 0 2px; }
  .slot-label { font-size: 13.5px; }
  .card-label { font-size: 14.5px; }
  .card-file { gap: 8px; }
  .btn { min-height: 44px; }
  .btn-lg { width: 100%; }
  .total-panel { padding: 10px 12px 14px; }
  .total-top { margin-bottom: 8px; }
  .total-title { font-size: 14px; }
  .total-pct { font-size: 18px; min-width: 52px; }
  .total-bar { height: 14px; }
  .total-meta { font-size: 12px; margin-top: 6px; }
  .total-actions { flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .total-actions .btn { flex: 1 1 0; }
  .global-status { flex: 1 1 100%; margin-left: 0; }
  .authbar { padding: 12px 14px; gap: 10px; border-radius: 12px; }
  .authbar-form { width: 100%; }
  .code-input { flex: 1 1 auto; width: auto; min-width: 0; }
  .auth-state { flex: 1 1 100%; }
  .up-file { flex-wrap: wrap; }
  .up-file-name { max-width: 100%; }
  .up-file-actions { width: 100%; }
  .up-file-actions .btn { flex: 1 1 0; min-height: 40px; }
  .group-count { margin-left: 0; }
}
