:root {
  --bg: #ffffff;
  --ink: #2c2c2c;
  --muted: #6b6b6b;
  --border: #e5e2dc;
  --card: #ffffff;
  --assess-pane: #f5f2ec;
  --admin-pane: #eef8f3;
  --blue: #c67a52;
  --dark: #6b6b6b;
  --green: #2f855a;
  --teal: #2f855a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', 'Inter', 'Noto Sans SC', 'PingFang SC', sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.single-page {
  max-width: 1040px;
  margin: 18px auto;
  padding: 0 12px 18px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

/* 当 splash overlay 存在时，确保 main 内容可见 */
.splash-overlay.fade-out ~ main.single-page,
.splash-overlay.fade-out ~ .single-page {
  opacity: 1;
  visibility: visible;
}

.hero-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.hero-card h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.hero-title {
  font-size: 32px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em;
  color: #2c2c2c;
}

.hero-subtitle {
  margin: 6px 0 0 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #6b6b6b !important;
  letter-spacing: 0.04em;
}

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #faf8f4 0%, #f0ece4 40%, #e8e2d8 100%);
  transition: opacity 0.5s ease;
}

.splash-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 48px;
  text-align: center;
  animation: splash-in 0.8s ease-out;
}

@keyframes splash-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-logo {
  margin-bottom: 8px;
}

.splash-logo-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 20px;
  animation: splash-logo-breathe 3s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(198, 122, 82, 0.18);
}

@keyframes splash-logo-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.splash-company {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #2c2c2c;
}

.splash-slogan {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #6b6b6b;
  letter-spacing: 0.06em;
}

.splash-divider {
  width: 48px;
  height: 2px;
  background: #c67a52;
  border-radius: 1px;
  margin: 10px 0;
  opacity: 0.6;
}

.splash-product {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #3d3830;
  letter-spacing: 0.08em;
}

.splash-version {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  color: #999;
  letter-spacing: 0.03em;
}

.splash-enter-btn {
  margin-top: 18px;
  padding: 14px 56px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #c67a52;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(198, 122, 82, 0.3);
}

.splash-enter-btn:hover {
  background: #b56a42;
  box-shadow: 0 6px 24px rgba(198, 122, 82, 0.4);
  transform: translateY(-1px);
}

.splash-enter-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(198, 122, 82, 0.3);
}

.splash-footer {
  margin: 16px 0 0;
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.02em;
}

.page-footer {
  text-align: center;
  padding: 20px 12px 16px;
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.02em;
}

.step1-login-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 28px 24px;
  border-radius: 16px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.step1-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #2c2c2c;
  margin: 0 0 6px;
}

.step1-desc {
  text-align: center;
  font-size: 13px;
  color: #999;
  margin: 0 0 24px;
}

.step1-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step1-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a4a4a;
  margin-bottom: 6px;
}

.step1-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #f9f7f3;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0;
}

.step1-field input::placeholder {
  color: #bbb;
}

.step1-field input:focus {
  outline: none;
  border-color: #c67a52;
  box-shadow: 0 0 0 3px rgba(198, 122, 82, 0.12);
  background: #fff;
}

.step1-submit-btn {
  width: 100%;
  padding: 13px 0;
  font-size: 15px;
  border-radius: 10px;
  margin-top: 6px;
}

.hero-card p {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.pane {
  border-radius: 12px;
  padding: 16px;
}

.pane-assessment {
  /* background: var(--assess-pane); */
}

#step1Card {
  margin-top: 200px;
}

.pane-admin {
  background: var(--admin-pane);
}

.pane h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.pane-assessment h2 {
  color: #2c2c2c;
}

.pane-admin h2 {
  color: #065f46;
}

.desc {
  margin: 6px 0 12px;
  font-size: 13px;
  color: #334155;
}

.card {
  background: var(--card);
  /* border: 1px solid var(--border); */
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  /* margin-bottom: 12px; */
  background: #f8fafc;
}

button {
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  color: #0e0d0d;
}

.btn-blue {
  background: var(--blue);
}

.btn-dark {
  background: var(--dark);
}

.btn-green {
  background: var(--green);
}

.btn-teal {
  background: var(--teal);
}

button.secondary {
  background: var(--dark);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-weight: 600;
  font-size: 12px;
}

.question {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}

.question:last-child {
  border-bottom: none;
}

.result-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none;
}

.step-card {
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.card-loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 244, 0.82);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
  border-radius: 12px;
}

.step-card.card-loading .card-loading-overlay {
  display: flex;
}

.step-card.card-loading {
  pointer-events: none;
}

.card-loading-spinner {
  position: relative;
  width: 40px;
  height: 40px;
}

.card-loading-spinner .spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.card-loading-spinner .spinner-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--blue);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}

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

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

.card-loading-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-weight: 500;
}

.progress-chip {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #6b6b6b;
  background: #f1eee8;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #c67a52, #e8a87c);
  transition: width 0.4s ease;
  width: 0%;
}

.step-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.btn-muted {
  background: #334155;
}

.question-title {
  margin: 8px 0 16px;
  font-size: 17px;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.7;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  text-align: left;
  border: 2px solid #e8e0d8;
  background: #ffffff;
  color: #334155 !important;
  border-radius: 12px;
  padding: 14px 16px 14px 44px;
  font-size: 15px;
  line-height: 1.5;
  transition: all 0.2s ease;
  position: relative;
}

.option-btn:hover {
  background: #faf6f2;
  border-color: #c9b8a8;
}

.option-btn.selected {
  border-color: #c67a52;
  background: #fdf5f0;
  color: #a85f3b !important;
  box-shadow: 0 0 0 3px rgba(198, 122, 82, 0.2);
  font-weight: 700;
}

.option-btn.selected::before {
  content: '✓';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: #c67a52;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}

.option-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.submit-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(2px);
  color: #64748b;
  font-size: 15px;
}

.submit-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #c67a52;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.result-pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #166534;
}

.result-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}

.result-chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.chip-green {
  background: #f4efe8;
  color: #a85f3b;
}

.chip-blue {
  background: #f5f2ec;
  color: #6b6b6b;
}

.chip-amber {
  background: #f5f2ec;
  color: #6b6b6b;
}

.result-advice {
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
}

.scale-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 10px;
}

.category-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 16px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0;
}

.tag-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.tag-grid-item:hover {
  background: #eef2f6;
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tag-grid-icon {
  font-size: 32px;
  line-height: 1;
}

.tag-grid-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.tag-grid-count {
  font-size: 12px;
  color: var(--muted);
}

.complete-wrapper {
  padding: 32px 16px 24px;
  text-align: center;
}
.complete-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
  color: #22543d;
  font-size: 38px;
  line-height: 72px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(104, 211, 145, 0.35);
}
.complete-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
}
.complete-desc {
  text-align: center;
  color: #718096;
  font-size: 14px;
  line-height: 1.6;
}
.complete-actions {
  display: flex;
  gap: 12px;
  padding: 0 16px 24px;
}
.complete-actions button {
  flex: 1;
  padding: 12px 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}
.btn-outline {
  background: #fff;
  border: 2px solid #e2e0dc;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover {
  border-color: #c67a52;
  color: #c67a52;
  background: #fdf5f0;
}

.tag-list-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
}

.tag-list-header h3 {
  margin: 0;
  font-size: 16px;
}

.btn-back {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-back:hover {
  background: #eef2f6;
  border-color: #94a3b8;
}

.tag-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 32px 0;
}

.scale-option-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scale-option-card h4 {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
}

.scale-option-card p {
  margin: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
  flex: 1;
}

.scale-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.scale-intro-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.25;
}

.scale-intro-row .k {
  width: 52px;
  flex: 0 0 auto;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.scale-intro-row .v {
  flex: 1 1 auto;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.dimension-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dimension-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
}

.dimension-title {
  font-size: 12px;
  font-weight: 700;
  color: #2c2c2c;
}

.dimension-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #a85f3b;
  font-weight: 600;
}

.dimension-text {
  margin-top: 6px;
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
}

.dimension-domain-card {
  background: #f8f6f2;
}

.dimension-children {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dimension-facet-card {
  margin-left: 14px;
  background: #ffffff;
}

@media (max-width: 640px) {
  .step-actions {
    flex-direction: column;
  }

  .scale-card-grid {
    grid-template-columns: 1fr;
  }

  .tag-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tag-grid-item {
    padding: 14px 8px;
  }

  .tag-grid-icon {
    font-size: 26px;
  }

  .tag-grid-label {
    font-size: 13px;
  }
}

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.scale-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.scale-card-actions button {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
}

.scale-progress-hint {
  font-size: 11px;
  color: #c67a52;
  font-weight: 600;
  margin-bottom: 2px;
}

.mhm-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(28, 25, 23, 0.82);
  color: #fff;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
  max-width: 260px;
  backdrop-filter: blur(6px);
}

.mhm-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
