/* SPSSzero 上传页面独立样式 - 与主站隔离 */
:root {
  --up-primary: #2461ff;
  --up-primary-dark: #1a4ed8;
  --up-primary-light: #eef3ff;
  --up-text: #1a2332;
  --up-text-muted: #6b7280;
  --up-bg: #f7f9fc;
  --up-card: #ffffff;
  --up-border: #e5e9f0;
  --up-border-active: #b3c7f5;
  --up-success: #10b981;
  --up-warn: #f59e0b;
  --up-danger: #ef4444;
  --up-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --up-shadow-hover: 0 4px 12px rgba(36, 97, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: var(--up-bg);
  color: var(--up-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ========== 顶部条 ========== */
.up-header {
  background: var(--up-card);
  border-bottom: 1px solid var(--up-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.up-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.up-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--up-text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all .15s;
}
.up-back:hover { color: var(--up-primary); background: var(--up-primary-light); }
.up-logo {
  text-decoration: none;
  color: var(--up-text);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.up-logo strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--up-primary);
  letter-spacing: -0.3px;
}
.up-logo span {
  font-size: 12px;
  color: var(--up-text-muted);
}
.up-enter {
  background: var(--up-primary);
  color: #fff;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.up-enter:hover { background: var(--up-primary-dark); transform: translateY(-1px); }

/* ========== 主体 ========== */
.up-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

/* ========== 步骤条 ========== */
.up-steps {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 32px 0;
  padding: 0;
}
.up-steps .step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e9f0;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: all .25s;
}
.step-label {
  font-size: 14px;
  color: #9ca3af;
  font-weight: 500;
  transition: color .25s;
}
.step.active .step-num {
  background: var(--up-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(36, 97, 255, .12);
}
.step.active .step-label { color: var(--up-primary); font-weight: 600; }
.step.done .step-num { background: var(--up-success); color: #fff; }
.step.done .step-label { color: var(--up-success); }
.step-bar {
  width: 60px;
  height: 2px;
  background: #e5e9f0;
  border-radius: 1px;
}

/* ========== 上传区 + 说明 ========== */
.up-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.up-zone {
  background: var(--up-card);
  border: 2px dashed #c8d3e6;
  border-radius: 14px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.up-zone:hover {
  border-color: var(--up-primary);
  background: var(--up-primary-light);
}
.up-zone.dragover {
  border-color: var(--up-primary);
  background: var(--up-primary-light);
  transform: scale(1.01);
}
.up-zone-inner {
  text-align: center;
  padding: 32px;
}
.up-icon {
  width: 64px;
  height: 64px;
  color: var(--up-primary);
  margin-bottom: 16px;
  opacity: .85;
}
.up-zone-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--up-text);
  margin-bottom: 8px;
}
.up-zone-sub {
  font-size: 13px;
  color: var(--up-text-muted);
  margin-bottom: 24px;
}
.up-btn-pick {
  background: var(--up-primary);
  color: #fff;
  border: none;
  padding: 10px 32px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.up-btn-pick:hover {
  background: var(--up-primary-dark);
  box-shadow: 0 4px 12px rgba(36, 97, 255, .25);
}

/* 上传中态 */
.up-zone-progress {
  text-align: center;
  width: 80%;
  max-width: 400px;
  padding: 32px;
}
.up-progress-name {
  font-size: 14px;
  color: var(--up-text);
  margin-bottom: 14px;
  font-weight: 500;
  word-break: break-all;
}
.up-progress-bar {
  height: 6px;
  background: #e5e9f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.up-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--up-primary), #5b8aff);
  width: 0%;
  transition: width .3s ease;
  border-radius: 3px;
}
.up-progress-status {
  font-size: 12px;
  color: var(--up-text-muted);
}

/* ========== 右侧规则 ========== */
.up-rules {
  background: var(--up-card);
  border: 1px solid var(--up-border);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: var(--up-shadow);
}
.up-rules h2 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--up-text);
}
.up-rules ul {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}
.up-rules li {
  position: relative;
  padding: 6px 0 6px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #374151;
}
.up-rules li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--up-primary);
  font-weight: bold;
}
.up-rules li b { color: var(--up-text); font-weight: 600; }
.up-rules li code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  color: var(--up-primary-dark);
}
.up-rules-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--up-border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.up-rules-foot a {
  color: var(--up-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.up-rules-foot a:hover { text-decoration: underline; }

/* ========== 表格示例 ========== */
.up-example {
  background: var(--up-card);
  border: 1px solid var(--up-border);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: var(--up-shadow);
}
.up-example h2 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--up-text);
}
.up-example-card {
  background: #fafbfd;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
}
.up-example-svg {
  width: 100%;
  max-height: 360px;
  display: block;
  margin: 0 auto;
}
.up-example-tips {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--up-text-muted);
}
.tip-good { color: var(--up-success); font-weight: 500; }
.tip-bad { color: var(--up-danger); font-weight: 500; }

/* ========== 步骤 2：数据预览 ========== */
.up-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--up-card);
  border: 1px solid var(--up-border);
  border-radius: 14px;
  padding: 20px 28px;
  margin-bottom: 16px;
  box-shadow: var(--up-shadow);
}
.up-preview-meta {
  display: flex;
  gap: 32px;
}
.meta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.meta-label {
  font-size: 12px;
  color: var(--up-text-muted);
}
.meta-row b {
  font-size: 16px;
  color: var(--up-text);
  font-weight: 600;
}
.up-preview-actions {
  display: flex;
  gap: 12px;
}
.up-btn-secondary,
.up-btn-primary {
  border: none;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.up-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}
.up-btn-secondary:hover { background: #e5e9f0; }
.up-btn-primary {
  background: var(--up-primary);
  color: #fff;
}
.up-btn-primary:hover {
  background: var(--up-primary-dark);
  box-shadow: 0 4px 12px rgba(36, 97, 255, .25);
}

.up-preview-table-wrap {
  background: var(--up-card);
  border: 1px solid var(--up-border);
  border-radius: 14px;
  overflow: auto;
  max-height: 60vh;
  box-shadow: var(--up-shadow);
}
.up-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.up-preview-table thead {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}
.up-preview-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--up-text);
  border-bottom: 2px solid var(--up-border);
  white-space: nowrap;
}
.up-preview-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f2f5;
  color: #374151;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-preview-table tbody tr:hover { background: #fafbfd; }
.up-preview-foot {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: var(--up-text-muted);
}

/* ========== Toast ========== */
.up-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(26, 35, 50, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.up-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.up-toast.success { background: var(--up-success); }
.up-toast.error { background: var(--up-danger); }
.up-toast.warn { background: var(--up-warn); }

/* ========== 弹窗 ========== */
.up-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.up-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(2px);
}
.up-modal-card {
  position: relative;
  background: var(--up-card);
  border-radius: 16px;
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}
.up-modal-head {
  padding: 20px 28px;
  border-bottom: 1px solid var(--up-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.up-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.up-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--up-text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.up-modal-close:hover { background: #f3f4f6; color: var(--up-text); }
.up-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
}
.up-modal-body h4 {
  margin: 20px 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--up-primary);
}
.up-modal-body h4:first-child { margin-top: 0; }
.up-modal-body ul { padding-left: 22px; margin: 8px 0; }
.up-modal-body li { padding: 3px 0; }
.up-modal-body code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  color: var(--up-primary-dark);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .up-main { padding: 20px 16px; }
  .up-grid { grid-template-columns: 1fr; }
  .up-zone { min-height: 240px; }
  .up-header-inner { padding: 12px 16px; gap: 12px; }
  .up-logo span { display: none; }
  .step-bar { width: 30px; }
  .step-label { display: none; }
  .up-preview-head { flex-direction: column; gap: 14px; align-items: stretch; }
  .up-preview-meta { gap: 18px; flex-wrap: wrap; }
  .up-preview-actions { justify-content: stretch; }
  .up-btn-secondary, .up-btn-primary { flex: 1; }
}
