* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #1f2329;
  font-size: 14px;
  line-height: 1.5;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 32px 28px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { font-size: 20px; margin-top: 12px; color: #111827; }
.login-header p { font-size: 13px; color: #6b7280; margin-top: 4px; }

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #1677ff;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-logo.sm { width: 38px; height: 38px; font-size: 18px; border-radius: 10px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #374151; }
.form-group input, .text-input {
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.form-group input:focus, .text-input:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.alert-err {
  background: #fdecec;
  border: 1px solid #f8c6c6;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

.container { max-width: 1380px; margin: 0 auto; padding: 20px 24px 36px; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.header h1 { font-size: 20px; font-weight: 600; color: #111827; }
.subtitle { font-size: 13px; color: #6b7280; margin-top: 2px; }
.auth-panel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge-ok { background: #e6f7ee; color: #0b7a44; }
.badge-err { background: #fdecec; color: #c92a2a; }
.badge-neutral { background: #eef1f6; color: #4b5563; }

.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-bottom: 16px;
}
.controls-card { padding: 18px 20px; }

.guide-banner {
  padding: 14px 18px;
  background: #fffbeb;
  border-color: #fde68a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.guide-banner p { font-size: 13px; color: #92400e; margin-top: 2px; }

.upload-row { display: flex; align-items: stretch; gap: 14px; margin-bottom: 16px; }
.drop-zone {
  flex: 1;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 18px 20px;
  text-align: center;
  cursor: pointer;
  background: #fafcff;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.drop-zone:hover, .drop-zone.dragover { border-color: #1677ff; background: #f0f7ff; }
.drop-title { font-weight: 600; color: #1f2937; }
.drop-hint { font-size: 12px; color: #6b7280; margin-top: 4px; }
.quick-actions { display: flex; flex-direction: column; justify-content: center; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label { font-size: 13px; color: #4b5563; display: inline-flex; align-items: center; gap: 6px; }
.filter-label select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; padding: 10px; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-primary { background: #1677ff; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0958d9; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover:not(:disabled) { background: #d97706; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-outline { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-outline:hover:not(:disabled) { border-color: #1677ff; color: #1677ff; }
.btn-ghost { background: transparent; color: #4b5563; }
.btn-ghost:hover:not(:disabled) { background: #eef1f6; }

.progress-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0f2f5; }
.progress-top { display: flex; justify-content: space-between; font-size: 13px; color: #374151; margin-bottom: 6px; }
.progress-bar-bg { width: 100%; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: #1677ff; transition: width 0.2s ease; }

.stats-bar { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid #f0f2f5; }
.stat-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stat-label { font-size: 12px; color: #6b7280; }
.stat-item strong { font-size: 16px; color: #111827; }
.stat-blue strong { color: #1677ff; }
.stat-green strong { color: #059669; }
.stat-gray strong { color: #6b7280; }
.stat-red strong { color: #dc2626; }

.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; max-height: 60vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  z-index: 1;
}
tbody td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:hover { background: #f9fbff; }
.empty-row td { text-align: center; color: #9ca3af; padding: 42px 12px; }

.diff-down { color: #059669; font-weight: 600; }
.diff-up { color: #ea580c; font-weight: 600; }
.diff-zero { color: #9ca3af; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag-ready { background: #e8f3ff; color: #1677ff; }
.tag-done { background: #e6f7ee; color: #0b7a44; }
.tag-same { background: #f3f4f6; color: #6b7280; }
.tag-err { background: #fdecec; color: #c92a2a; }
.tag-pending { background: #f8fafc; color: #64748b; }

.note-cell { font-size: 12px; color: #6b7280; max-width: 220px; word-break: break-all; }
.footer { text-align: center; font-size: 12px; color: #6b7280; margin-top: 8px; }

.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #111827; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-switch-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
