/*
  中文大文件上传页 UI：
  - 响应式卡片布局
  - 渐变背景、玻璃拟态、清晰错误面板
  - 文件预览、进度条、成功/失败状态
*/

:root {
  --bg-1: #0f172a;
  --bg-2: #172554;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.28);
  --primary: #2563eb;
  --primary-2: #7c3aed;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #f97316;
  --danger: #dc2626;
  --danger-bg: #fff1f2;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    "PingFang SC",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 12%, rgba(96, 165, 250, 0.38), transparent 26rem),
    radial-gradient(circle at 82% 8%, rgba(168, 85, 247, 0.32), transparent 28rem),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 48%, #312e81);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.decor {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.55;
}

.decor-one {
  width: 340px;
  height: 340px;
  left: -140px;
  top: 180px;
  background: rgba(14, 165, 233, 0.45);
}

.decor-two {
  width: 300px;
  height: 300px;
  right: -120px;
  bottom: 80px;
  background: rgba(236, 72, 153, 0.35);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 36px auto 60px;
}

.hero-card,
.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  border-radius: var(--radius-xl);
  padding: 34px;
  color: white;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(124, 58, 237, 0.88)),
    rgba(255, 255, 255, 0.14);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.86rem;
  font-weight: 800;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-subtitle {
  max-width: 760px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.hero-stats div {
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.hero-note {
  align-self: stretch;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: 24px;
  padding: 22px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.note-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.hero-note strong {
  font-size: 1.05rem;
}

.hero-note p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  margin-top: 22px;
}

.glass-panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.section-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.compact-title {
  margin-top: 28px;
}

.section-index {
  flex: 0 0 auto;
  min-width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.13), rgba(124, 58, 237, 0.13));
  color: var(--primary-dark);
  font-weight: 900;
}

.section-title h2,
.progress-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-title p,
.progress-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 850;
}

label em {
  color: var(--danger);
  font-style: normal;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.78);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.13);
  background: white;
}

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

.field-error {
  display: none;
  color: var(--danger);
  font-weight: 800;
}

.field.has-error input[type="text"],
.field.has-error textarea,
.field.has-error .drop-zone {
  border-color: rgba(220, 38, 38, 0.72);
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.1);
  background: #fff7f7;
}

.field.has-error .field-error {
  display: block;
}

.drop-zone {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 238px;
  padding: 28px;
  border: 2px dashed rgba(37, 99, 235, 0.42);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(250, 245, 255, 0.88));
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.8);
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 1), rgba(245, 243, 255, 1));
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
}

.drop-zone h3 {
  margin: 18px 0 8px;
  font-size: 1.2rem;
}

.drop-zone p {
  max-width: 560px;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.ghost-btn,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.ghost-btn {
  color: var(--primary-dark);
  background: white;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.primary-btn {
  color: white;
  min-width: 180px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
}

.secondary-btn {
  color: #334155;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.file-preview {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.file-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.72);
}

.file-chip strong {
  overflow-wrap: anywhere;
}

.file-chip .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.file-chip .status-pill {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  color: #166534;
  background: #dcfce7;
}

.file-chip.error {
  border-color: rgba(220, 38, 38, 0.35);
  background: #fff1f2;
}

.file-chip.error .status-pill {
  color: #991b1b;
  background: #fee2e2;
}

.error-panel {
  margin-top: 22px;
  border: 1px solid rgba(220, 38, 38, 0.26);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 255, 255, 0.92));
}

.error-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.error-heading span {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--danger);
  font-weight: 900;
}

.error-heading strong {
  display: block;
  color: #991b1b;
  font-size: 1.05rem;
}

.error-heading p {
  margin: 5px 0 0;
  color: #b91c1c;
}

#errorList {
  margin: 14px 0 0;
  padding-left: 22px;
  color: #7f1d1d;
  line-height: 1.7;
}

.warning-box {
  margin-top: 22px;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(249, 115, 22, 0.32);
  border-radius: 20px;
  padding: 16px;
  color: #9a3412;
  background: #fff7ed;
}

.warning-box span {
  line-height: 1.7;
}

.side-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.mini-card {
  padding: 22px;
}

.mini-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 900;
  margin-bottom: 14px;
}

.mini-card h3 {
  margin: 0 0 8px;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.progress-panel,
.summary-panel {
  margin-top: 22px;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.overall-card {
  margin-top: 18px;
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.progress-label,
.progress-meta,
.file-progress-footer,
.file-progress-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-label span {
  font-weight: 900;
  color: var(--primary-dark);
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  margin-top: 12px;
  background: #dbe4f0;
}

.big-track {
  height: 16px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #38bdf8, var(--primary-2));
  transition: width 0.16s ease;
}

.progress-meta,
.file-progress-footer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.file-progress-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.file-name {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.file-size {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 11px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 0.82rem;
  font-weight: 900;
}

.badge.success {
  color: #166534;
  background: #dcfce7;
}

.badge.error {
  color: #991b1b;
  background: #fee2e2;
}

.badge.warning {
  color: #9a3412;
  background: #ffedd5;
}

.file-result {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.summary-message {
  border-radius: 20px;
  padding: 16px;
  margin: 0 0 16px;
  line-height: 1.7;
}

.summary-message.success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid rgba(22, 163, 74, 0.24);
}

.summary-message.error {
  color: #991b1b;
  background: #fff1f2;
  border: 1px solid rgba(220, 38, 38, 0.24);
}

.summary-table-wrap {
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.summary-table th,
.summary-table td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
}

.summary-table th {
  color: var(--muted);
  font-size: 0.88rem;
}

.codeish {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.noscript {
  position: fixed;
  z-index: 20;
  left: 16px;
  right: 16px;
  bottom: 16px;
  border-radius: 16px;
  padding: 14px 16px;
  color: #991b1b;
  background: #fee2e2;
  font-weight: 900;
}

@media (max-width: 980px) {
  .hero-card,
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .hero-note {
    max-width: none;
  }

  .side-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    margin: 18px auto 40px;
  }

  .hero-card,
  .glass-panel {
    border-radius: 22px;
    padding: 20px;
  }

  .hero-stats,
  .form-grid,
  .side-panel {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 220px;
    padding: 22px 16px;
  }

  .actions-row,
  .progress-label,
  .progress-meta,
  .file-progress-footer,
  .file-progress-title,
  .progress-header {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .file-chip {
    grid-template-columns: 1fr;
  }
}
