.test-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(232, 74, 127, 0.1), transparent 32%),
    radial-gradient(circle at 78% 0%, rgba(6, 182, 212, 0.085), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 44%),
    var(--bg-dark);
}

.test-page::before {
  content: '';
  position: fixed;
  inset: 68px 0 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 64%);
  opacity: 0.72;
}

.test-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(72px, 9vh, 92px) 0 clamp(48px, 7vh, 72px);
  position: relative;
  z-index: 1;
}

.test-library {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
  max-width: none;
  margin: 0;
  padding: 72px 0 0;
}

.test-tile {
  --tile-accent: 232, 74, 127;
  --tile-accent-2: 6, 182, 212;
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: 258px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  color: var(--text);
  text-decoration: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--tile-accent), 0.12), transparent 38%),
    radial-gradient(circle at 100% 8%, rgba(var(--tile-accent-2), 0.075), transparent 32%),
    linear-gradient(180deg, rgba(31, 32, 37, 0.965), rgba(16, 17, 21, 0.985)),
    #121318;
  border: 1px solid rgba(var(--tile-accent), 0.22);
  border-radius: 8px;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  isolation: isolate;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.test-tile *,
.test-tile::before,
.test-tile::after {
  box-sizing: border-box;
}

.test-tile > * {
  position: relative;
  z-index: 1;
}

.test-tile::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(var(--tile-accent), 0.95), rgba(var(--tile-accent-2), 0.66), transparent 78%);
  z-index: 0;
}

.test-tile::after {
  content: '';
  position: absolute;
  inset: 1px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 48%);
  border-radius: 7px;
  opacity: 0.9;
  z-index: 0;
}

.test-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--tile-accent), 0.36);
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--tile-accent), 0.16), transparent 38%),
    radial-gradient(circle at 100% 8%, rgba(var(--tile-accent-2), 0.1), transparent 32%),
    linear-gradient(180deg, rgba(36, 37, 42, 0.98), rgba(18, 19, 23, 0.995)),
    #15161b;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.27),
    0 0 0 1px rgba(var(--tile-accent), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.test-tile:focus-visible {
  outline: 2px solid rgba(var(--tile-accent), 0.72);
  outline-offset: 4px;
}

.tile-kicker {
  align-self: flex-start;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: rgba(var(--tile-accent), 0.98);
  background: rgba(var(--tile-accent), 0.105);
  border: 1px solid rgba(var(--tile-accent), 0.24);
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.tile-icon {
  display: none;
}

.accent-cyan,
.accent-violet {
  --tile-accent: 232, 74, 127;
  --tile-accent-2: 6, 182, 212;
}

.tile-title {
  display: block;
  margin-top: 44px;
  color: #fff;
  font-size: 28px;
  font-weight: 740;
  line-height: 1.22;
  letter-spacing: 0;
}

.tile-desc {
  display: block;
  min-height: 44px;
  margin-top: 10px;
  color: rgba(214, 222, 235, 0.74);
  font-size: 14px;
  line-height: 1.58;
  letter-spacing: 0;
}

.tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin-top: 24px;
}

.tile-title + .tile-meta {
  margin-top: 38px;
}

.tile-meta span {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: rgba(235, 241, 248, 0.76);
  background: rgba(var(--tile-accent), 0.075);
  border: 1px solid rgba(var(--tile-accent), 0.17);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
}

.tile-action {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 0 15px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(var(--tile-accent), 0.14), rgba(var(--tile-accent-2), 0.08)),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--tile-accent), 0.22);
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tile-action i {
  width: 18px;
  height: 18px;
  position: relative;
  flex: 0 0 18px;
  color: transparent;
  transition: transform 0.2s ease;
}

.tile-action i::before,
.tile-action i::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 2px;
  display: block;
}

.tile-action i::before {
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(var(--tile-accent), 0.96);
  border-right: 2px solid rgba(var(--tile-accent), 0.96);
  transform: translateY(-50%) rotate(45deg);
}

.tile-action i::after {
  width: 14px;
  height: 2px;
  background: rgba(var(--tile-accent), 0.96);
  transform: translateY(-50%);
}

.test-tile:hover .tile-action {
  background: rgba(var(--tile-accent), 0.11);
  border-color: rgba(var(--tile-accent), 0.28);
}

.test-tile:hover .tile-action i {
  transform: translateX(4px);
}

.quiz-shell {
  width: min(860px, 100%);
  margin: 0 auto;
}

.quiz-back {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.quiz-back:hover {
  color: #fff;
  transform: translateX(-3px);
}

.test-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  max-width: none;
  margin: 0;
  padding: 0;
}

.test-catalog {
  display: grid;
  gap: 12px;
  align-content: start;
}

.test-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 3px;
  align-items: center;
  min-height: 86px;
  padding: 16px;
  color: var(--text);
  background: rgba(18, 18, 26, 0.84);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.test-card i {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  border-radius: 8px;
  font-size: 18px;
}

.test-card span {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

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

.test-card:hover,
.test-card.active {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: rgba(232, 74, 127, 0.08);
}

.quiz-panel {
  min-height: 560px;
  padding: 28px;
  background: rgba(18, 18, 26, 0.88);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}

.quiz-kicker,
.question-count {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

.quiz-header h1,
.quiz-header h2 {
  margin: 0;
  color: #fff;
  font-size: 28px;
}

.quiz-description {
  max-width: 620px;
  margin: 10px 0 0;
  color: rgba(203, 213, 225, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.quiz-progress {
  min-width: 160px;
  text-align: right;
  color: var(--text-muted);
  font-size: 13px;
}

.quiz-progress-bar {
  height: 6px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

#quizProgressFill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transition: width 0.3s ease;
}

.question-block h2,
.question-block h3 {
  margin: 0 0 22px;
  color: #fff;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.3;
}

.question-note {
  margin: -8px 0 22px;
  padding: 14px 16px;
  color: rgba(203, 213, 225, 0.78);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.75;
}

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-list.text-input-mode {
  gap: 8px;
}

.answer-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.answer-option:hover,
.answer-option.selected {
  transform: translateX(4px);
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.08);
}

.answer-marker {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(232, 74, 127, 0.18);
  border-radius: 8px;
  font-weight: 700;
}

.answer-option.selected .answer-marker {
  background: var(--cyan);
}

.survey-limit {
  color: rgba(203, 213, 225, 0.68);
  font-size: 13px;
}

.survey-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 14px/1.7 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.survey-textarea:focus {
  border-color: rgba(6, 182, 212, 0.55);
  background: rgba(6, 182, 212, 0.055);
}

.survey-text-counter {
  justify-self: end;
  color: rgba(203, 213, 225, 0.58);
  font-size: 12px;
}

.answer-list.needs-answer {
  animation: shakeAnswer 0.42s ease;
}

@keyframes shakeAnswer {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.quiz-footer,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.quiz-footer {
  justify-content: space-between;
}

.quiz-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  color: #fff;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.quiz-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz-btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.quiz-btn.primary {
  background: var(--primary);
}

.quiz-btn.primary:hover {
  box-shadow: 0 14px 30px rgba(232, 74, 127, 0.3);
}

.quiz-btn.qq {
  background: linear-gradient(135deg, #12b7f5, #0d9ddb);
}

.submit-confirm {
  display: grid;
  gap: 18px;
}

.submit-confirm h2 {
  margin: 0;
  color: #fff;
  font-size: 26px;
}

.confirm-list {
  display: grid;
  gap: 10px;
}

.confirm-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  color: rgba(226, 232, 240, 0.84);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  line-height: 1.65;
}

.confirm-item span {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(232, 74, 127, 0.18);
  border-radius: 8px;
  font-weight: 700;
}

.confirm-item p {
  margin: 0;
  font-size: 14px;
}

.quiz-btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.result-panel {
  margin-top: 28px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
}

.result-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--green);
  background: rgba(34, 197, 94, 0.12);
  border-radius: 8px;
  font-size: 20px;
}

.result-panel h2,
.result-panel h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 22px;
}

.result-panel p {
  margin: 0;
  color: var(--text);
}

.result-details {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.result-notice {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  color: rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  line-height: 1.65;
}

.result-notice strong {
  color: #fff;
  font-size: 14px;
}

.result-notice span {
  color: rgba(203, 213, 225, 0.76);
  font-size: 14px;
}

.result-notice.warning {
  border-color: rgba(245, 158, 11, 0.36);
  background: rgba(245, 158, 11, 0.075);
}

.result-notice.danger {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.085);
}

.result-notice.muted {
  border-color: rgba(148, 163, 184, 0.2);
}

.forum-recommendations {
  display: grid;
  gap: 10px;
}

.forum-recommendation-title {
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.forum-result-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.forum-result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.36);
  background: rgba(6, 182, 212, 0.07);
}

.forum-result-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(232, 74, 127, 0.16);
  border: 1px solid rgba(232, 74, 127, 0.26);
  border-radius: 8px;
  font-size: 18px;
}

.forum-result-icon.icon-blue { background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.28); }
.forum-result-icon.icon-green { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.28); }
.forum-result-icon.icon-purple { background: rgba(168, 85, 247, 0.14); border-color: rgba(168, 85, 247, 0.28); }
.forum-result-icon.icon-yellow { background: rgba(234, 179, 8, 0.14); border-color: rgba(234, 179, 8, 0.28); }
.forum-result-icon.icon-orange { background: rgba(249, 115, 22, 0.14); border-color: rgba(249, 115, 22, 0.28); }
.forum-result-icon.icon-red { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.28); }
.forum-result-icon.icon-cyan { background: rgba(6, 182, 212, 0.14); border-color: rgba(6, 182, 212, 0.28); }
.forum-result-icon.icon-pink { background: rgba(232, 74, 127, 0.16); border-color: rgba(232, 74, 127, 0.26); }

.forum-result-body {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.forum-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.forum-result-title strong {
  min-width: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.forum-result-title em {
  flex: 0 0 auto;
  color: rgba(6, 182, 212, 0.96);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.forum-result-desc {
  color: rgba(203, 213, 225, 0.74);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.forum-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.forum-result-meta span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: rgba(226, 232, 240, 0.74);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 11px;
}

.result-type-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(232, 74, 127, 0.16), transparent 46%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 74, 127, 0.22);
  border-radius: 8px;
}

.result-type-card span {
  color: rgba(232, 74, 127, 0.94);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.result-type-card strong {
  color: #fff;
  font-size: 20px;
  line-height: 1.25;
}

.result-type-card p {
  margin: 0;
  color: rgba(203, 213, 225, 0.74);
  font-size: 14px;
  line-height: 1.7;
}

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

.result-dimension {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.result-dimension span {
  min-width: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 13px;
}

.result-dimension span:first-child {
  overflow-wrap: anywhere;
}

.result-dimension span:nth-child(2) {
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
}

.result-dimension-bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.result-dimension-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(232, 74, 127, 0.9), rgba(232, 74, 127, 0.46));
  border-radius: inherit;
}

.empty-quiz {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.empty-quiz-icon {
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: #fff;
  background: rgba(232, 74, 127, 0.16);
  border: 1px solid rgba(232, 74, 127, 0.3);
  border-radius: 8px;
  font-size: 26px;
}

.empty-quiz h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.12;
}

.empty-quiz p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
}

@media (max-width: 992px) {
  .test-main {
    width: min(100% - 40px, 760px);
    padding-top: 78px;
  }

  .test-workspace {
    grid-template-columns: 1fr;
  }

  .test-library,
  .test-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-library {
    padding-top: 60px;
  }
}

@media (max-width: 640px) {
  .test-main {
    width: 100%;
    max-width: 420px;
    padding: 64px 20px 44px;
  }

  .test-library,
  .test-catalog {
    grid-template-columns: 1fr;
  }

  .test-library {
    gap: 16px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 60px 0 0;
  }

  .test-tile {
    width: 100%;
    max-width: 100%;
    min-height: 238px;
    padding: 20px;
  }

  .test-tile::before {
    top: 18px;
    right: 18px;
    font-size: 44px;
  }

  .test-tile::after {
    inset: 1px;
    height: auto;
  }

  .tile-title {
    margin-top: 42px;
    font-size: 24px;
  }

  .tile-desc {
    min-height: auto;
  }

  .quiz-panel {
    padding: 22px;
  }

  .quiz-header {
    flex-direction: column;
  }

  .quiz-progress {
    width: 100%;
    text-align: left;
  }

  .quiz-description {
    font-size: 13px;
  }

  .quiz-footer {
    flex-direction: column-reverse;
  }

  .quiz-btn {
    width: 100%;
  }

  .result-breakdown {
    grid-template-columns: 1fr;
  }
}
