:root {
  color: #1f2937;
  background: #f3f4f6;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f3f4f6;
  color: #1f2937;
  font-size: 14px;
}

.page-shell, main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 14px 36px;
}

.page-header {
  text-align: center;
  margin-bottom: 16px;
}

.page-header h1, main > h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.3;
  text-align: center;
}

.page-header p {
  margin: 0;
  color: #6b7280;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.card h2 {
  margin-top: 0;
  line-height: 1.35;
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  color: #374151;
  font-weight: 600;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 150px;
}

button {
  margin-top: 12px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: opacity .2s, transform .2s, background .2s;
}

button:hover:not(:disabled) {
  opacity: .92;
  transform: translateY(-1px);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.muted {
  color: #6b7280;
}

#fileCount {
  color: #4338ca;
  background: #eef2ff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  min-height: 32px;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 16px;
}

.tab-button {
  min-width: 156px;
  border-radius: 12px;
  padding: 13px 28px;
  background: #e5e7eb;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}

.tab-button.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .2);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.status-banner {
  border-radius: 12px;
  margin: 16px 0;
  padding: 12px 14px;
}

.status-info {
  color: #1d4ed8;
  background: #eff6ff;
}

.status-success {
  color: #047857;
  background: #ecfdf5;
}

.status-error {
  color: #b91c1c;
  background: #fef2f2;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 12px;
}

.data-table th {
  color: #374151;
  background: #f9fafb;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  color: #4b5563;
  background: #e5e7eb;
}

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

.tag.warning {
  color: #92400e;
  background: #fef3c7;
}

.tag.danger {
  color: #991b1b;
  background: #fee2e2;
}

.tag.muted {
  color: #4b5563;
  background: #e5e7eb;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.radio-button-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.radio-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 0;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.radio-button input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.radio-button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
}

.radio-button-group.invalid .radio-button {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

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

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
}

.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #2563eb;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: spin 1s linear infinite;
}

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

.progress-shell {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
  margin-top: 14px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: #2563eb;
  transition: width .2s ease;
}

.progress-text {
  margin-top: 8px;
  color: #4b5563;
  font-weight: 600;
}

.pagination-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.pagination-row button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.summary-row {
  margin-bottom: 12px;
}

.summary-pill {
  color: #4338ca;
  background: #eef2ff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
}

.danger-button {
  background: #dc2626;
}

.generated-table th,
.generated-table td {
  white-space: nowrap;
}

.path-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .page-header h1, main > h1 {
    font-size: 24px;
  }

  .card {
    padding: 14px;
  }

  .radio-button-group,
  .format-grid {
    grid-template-columns: 1fr;
  }
}
