:root {
  --primary-color: #7fb3d5;
  --primary-dark: #5499c7;
  --text-color: #34495e;
  --muted-color: #7f8c8d;
  --soft-text: #95a5a6;
  --bg-color: #f0f3f4;
  --card-bg: #ffffff;
  --option-bg: #f8f9f9;
  --option-active: #d4e6f1;
  --line-color: #e7ecef;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text-color);
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(500px, 100%);
}

.panel {
  display: none;
  width: 100%;
  min-height: 560px;
  background: var(--card-bg);
  padding: 40px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel.is-visible {
  display: block;
  animation: panelIn 0.28s ease-out;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lock-panel,
.start-panel {
  text-align: center;
}

.kicker {
  margin: 0 0 12px;
  color: var(--soft-text);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  font-weight: 700;
}

h1 {
  margin: 0 0 20px;
  color: var(--primary-color);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 650;
}

.intro-copy {
  margin: 0 0 36px;
  color: var(--muted-color);
  font-size: 15px;
  line-height: 1.8;
}

.primary-btn,
.secondary-btn {
  min-height: 48px;
  border: 0;
  border-radius: 50px;
  padding: 0 28px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.primary-btn {
  min-width: 180px;
  color: #fff;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  box-shadow: 0 4px 15px rgba(84, 153, 199, 0.3);
}

.primary-btn:hover {
  box-shadow: 0 8px 22px rgba(84, 153, 199, 0.32);
}

.secondary-btn {
  color: var(--primary-dark);
  background: #f8f9f9;
  border: 1px solid var(--line-color);
}

.secondary-btn:hover {
  background: #ebf5fb;
}

.primary-btn:active,
.secondary-btn:active {
  transform: scale(0.96);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.digit-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 30px 0;
}

.digit-input {
  width: 50px;
  height: 60px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  background: #fff;
  color: var(--text-color);
  text-align: center;
  font-size: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.digit-input:focus {
  outline: none;
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.18);
}

.form-note,
.copy-note {
  min-height: 20px;
  margin: 16px 0 0;
  color: #909399;
  font-size: 13px;
}

.form-note.error,
.copy-note.error {
  color: #f56c6c;
}

.copy-note.success {
  color: #67c23a;
}

.type-strip,
.start-actions,
.result-actions,
.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.type-strip {
  margin: -12px 0 34px;
}

.type-strip span {
  color: var(--soft-text);
  background: #f8f9f9;
  border: 1px solid var(--line-color);
  border-radius: 50px;
  padding: 7px 11px;
  font-size: 12px;
}

.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  color: var(--soft-text);
  font-size: 13px;
}

#counter {
  color: var(--primary-dark);
  font-weight: 700;
}

.progress-track {
  height: 6px;
  margin-bottom: 28px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary-color);
  transition: width 0.28s ease;
}

.question-card {
  text-align: left;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.q-number {
  margin: 0 0 10px;
  color: var(--soft-text);
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.q-en {
  margin: 0 0 8px;
  color: #2c3e50;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
}

.q-zh {
  margin: 0 0 22px;
  color: var(--muted-color);
  font-size: 15px;
  line-height: 1.65;
}

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

.option-item {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-color);
  background: var(--option-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.option-item:hover,
.option-item:focus {
  outline: none;
  background: #ebf5fb;
}

.option-item:active {
  transform: scale(0.99);
}

.option-item.selected {
  color: #154360;
  background: var(--option-active);
  border-color: var(--primary-color);
  font-weight: 700;
}

.option-letter {
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  background: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.quiz-actions {
  margin-top: 28px;
}

.result-hero {
  margin: 18px 0 24px;
  text-align: center;
}

.result-label {
  margin: 0;
  color: #2c3e50;
  font-size: 24px;
  line-height: 1.28;
  font-weight: 800;
}

.result-copy {
  color: #566573;
  background: #f8f9f9;
  border-radius: 12px;
  padding: 18px;
  font-size: 14px;
  line-height: 1.75;
  text-align: justify;
}

.result-copy h2 {
  margin: 0 0 10px;
  color: #2c3e50;
  font-size: 18px;
  line-height: 1.4;
}

.result-copy p {
  margin: 0 0 13px;
}

.result-copy p:last-child {
  margin-bottom: 0;
}

.english-copy {
  color: #7f8c8d;
}

.result-actions {
  margin-top: 24px;
}

@media screen and (max-width: 480px) {
  body {
    align-items: flex-start;
    padding: 12px 8px;
  }

  .panel {
    min-height: calc(100vh - 24px);
    padding: 26px 20px;
    border-radius: 20px;
  }

  h1 {
    font-size: 25px;
  }

  .quiz-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .digit-input {
    width: 48px;
    height: 58px;
  }

  .primary-btn,
  .secondary-btn {
    flex: 1 1 138px;
    padding-inline: 18px;
  }
}
