/* 商业自查系统2.0 — 暗色主题 (会员版+付费版) */
/* 高端、沉浸 — 黑底白字 + 彩色顶部横线 + 模块分色 */

:root {
  --bg-body: #080b12;
  --bg-card: #0f1219;
  --bg-input: #141822;
  --bg-input-focus: #1a1e2a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-hint: #64748b;
  --border-subtle: #1e2330;
  --border-input: #252b3b;
  --border-focus: #3b82f6;
  --blue: #3b82f6;
  --green: #10b981;
  --orange: #f97316;
  --red: #ef4444;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.7;
}

/* ========== Header ========== */
.header {
  text-align: center;
  padding: 48px 24px 32px;
}
.header h1 {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.header p {
  color: var(--text-hint);
  font-size: 14px;
  margin-top: 8px;
}

/* ========== Container ========== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ========== Progress Bar ========== */
.progress-bar {
  max-width: 900px;
  margin: 0 auto 32px;
  padding: 0 24px;
  height: 5px;
  border-radius: 3px;
  background: #1e2433;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
  transition: width 0.4s ease;
}

/* ========== Step Indicators ========== */
.steps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  transition: color 0.3s;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e2433;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s;
}
.step-item.active { color: var(--blue); }
.step-item.active .step-num {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.2);
}
.step-item.done { color: var(--green); }
.step-item.done .step-num {
  background: var(--green);
  color: #fff;
}

/* ========== Step Content ========== */
.step-content { display: none; }
.step-content.active { display: block; }

/* ========== Form Card ========== */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  padding: 36px;
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle);
}
.form-card h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-card .subtitle {
  text-align: center;
  color: var(--text-hint);
  font-size: 13px;
  margin-bottom: 32px;
}

/* Module color accents — top border */
.card-blue  { border-top: 3px solid var(--blue); }
.card-green { border-top: 3px solid var(--green); }
.card-orange{ border-top: 3px solid var(--orange); }
.card-red   { border-top: 3px solid var(--red); }

.card-blue h2  { color: var(--blue); }
.card-green h2 { color: var(--green); }
.card-orange h2{ color: var(--orange); }
.card-red h2   { color: var(--red); }

.score-badge {
  font-size: 13px;
  color: var(--text-hint);
  font-weight: 400;
  margin-left: 8px;
}

/* ========== Score Groups ========== */
.score-group {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.score-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.item-score {
  font-size: 12px;
  color: var(--text-hint);
  font-weight: 400;
}

/* ========== Form Elements ========== */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.required {
  color: var(--red);
  font-weight: 700;
}
.hint {
  font-size: 12px;
  color: var(--text-hint);
  font-weight: 400;
  margin-left: 6px;
}

.form-row {
  display: flex;
  gap: 14px;
}
.form-row .half  { flex: 1; }
.form-row .third { flex: 1; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.2s;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
  background: var(--bg-input-focus);
}
input::placeholder, textarea::placeholder { color: #4a5568; }
textarea { resize: vertical; min-height: 80px; }

select {
  cursor: pointer;
  color: var(--text-primary);
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none; appearance: none;
  padding-right: 36px;
}
select option { background: var(--bg-card); color: var(--text-primary); }

/* ========== Range Slider ========== */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-label {
  font-size: 12px;
  color: var(--text-hint);
  flex: 0 0 auto;
}
.range-val {
  flex: 0 0 48px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--blue);
  background: rgba(59,130,246,0.1);
  border-radius: 8px;
  padding: 4px 0;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #ef4444, #f97316, #eab308, #22c55e, #10b981);
  outline: none;
  border: none;
  padding: 0;
  box-shadow: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]:focus { box-shadow: none; border: none; }

/* ========== Self Rate Buttons ========== */
.self-rate {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}
.rate-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-input);
  background: var(--bg-input);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-hint);
  cursor: pointer;
  transition: all 0.2s;
}
.rate-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239,68,68,0.1);
}
.rate-btn.selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.rate-desc {
  font-size: 12px;
  color: var(--text-hint);
  min-height: 18px;
  margin-bottom: 12px;
}

/* ========== Buttons ========== */
.btn-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}
.btn {
  padding: 13px 36px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-blue    { background: var(--blue);   color: #fff; }
.btn-green   { background: var(--green);  color: #fff; }
.btn-orange  { background: var(--orange); color: #fff; }
.btn-red     { background: var(--red);    color: #fff; }
.btn-secondary { background: var(--border-subtle); color: var(--text-secondary); }

.btn-blue:hover, .btn-green:hover, .btn-orange:hover, .btn-red:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  filter: brightness(1.1);
}
.btn-secondary:hover {
  background: var(--border-input);
  color: var(--text-primary);
}

/* ========== Loading ========== */
.loading {
  display: none;
  text-align: center;
  padding: 60px 0;
}
.loading.show { display: block; }
.spinner {
  width: 48px; height: 48px;
  margin: 0 auto 20px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p {
  color: var(--text-hint);
  font-size: 15px;
}

/* ========== Modal Overlay ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #1a1a2e;
  border: 1px solid #333355;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ========== Result Section ========== */
.result-section {
  display: none;
}
.result-section.show { display: block; }

.center-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.score-display {
  text-align: center;
  margin: 24px 0;
}
.score-circle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 4px solid var(--border-subtle);
  margin-bottom: 16px;
  transition: border-color 0.5s;
}
.score-circle.excellent { border-color: var(--green); box-shadow: 0 0 24px rgba(16,185,129,0.15); }
.score-circle.good      { border-color: #f59e0b; box-shadow: 0 0 24px rgba(245,158,11,0.15); }
.score-circle.fail      { border-color: var(--red); box-shadow: 0 0 24px rgba(239,68,68,0.15); }

.score-circle span:first-child {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
}
.score-unit {
  font-size: 14px;
  color: var(--text-hint);
}

.grade-text {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}
.grade-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Module score rows */
#scoreDetail {
  margin-top: 20px;
}
.module-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.module-name {
  flex: 0 0 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.module-bar-wrap {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border-subtle);
  overflow: hidden;
}
.module-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.module-score {
  flex: 0 0 52px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
}

/* CTA */
.cta-section {
  text-align: center;
  margin-top: 32px;
}
.cta-box {
  display: inline-block;
  padding: 24px 40px;
  background: rgba(59,130,246,0.08);
  border: 2px dashed var(--blue);
  border-radius: var(--radius);
  color: var(--text-primary);
}

/* ========== Mobile ========== */
@media (max-width: 768px) {
  .container { padding: 0 14px 60px; }
  .progress-bar { padding: 0 14px; }
  .form-card { padding: 24px 18px; }
  .form-row { flex-direction: column; gap: 0; }
  .steps { gap: 6px; flex-wrap: wrap; }
  .step-item { font-size: 11px; }
  .step-num { width: 24px; height: 24px; font-size: 12px; }
  .header h1 { font-size: 22px; }
  .btn { padding: 12px 24px; font-size: 14px; }
  .score-circle { width: 110px; height: 110px; }
  .score-circle span:first-child { font-size: 40px; }
}

/* QR容器居中 */

