:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --paper: #f2f4ef;
  --surface: #ffffff;
  --line: #e2e6e1;
  --teal: #0f766e;
  --teal-deep: #115e59;
  --teal-soft: #eefaf7;
  --teal-edge: #bfe3db;
  --amber: #d97706;
  --amber-soft: #fff8ec;
  --amber-edge: #f3d9a4;
  --green: #2e9e6b;
  --green-soft: #d9f5e7;
  --red: #dc2626;
  --red-soft: #fde8e8;
  --gray-fill: #e9eaec;
  --gray-edge: #d6d8db;
  --gray-text: #9aa0a6;
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

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

body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid #99f6e4;
  outline-offset: 2px;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}

.icon svg {
  width: 20px;
  height: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--teal);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  flex: 0 0 auto;
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-text p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

.stats {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 58px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

.stat b {
  font-size: 20px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat b small {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal-edge);
}

.icon-btn:active {
  transform: scale(0.94);
}

.label-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.label-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal-edge);
}

.label-btn:active {
  transform: scale(0.96);
}

.wrong-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.wrong-modal {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 560px;
  max-height: 84vh;
}

.wrong-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 48vh;
  overflow-y: auto;
  margin: 0 0 20px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbf9;
}

.wrong-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  text-align: left;
}

.wrong-item:nth-child(even) {
  background: #f2f5f1;
}

.wrong-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 700;
}

.wrong-word {
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.wrong-meaning {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.wrong-empty {
  padding: 28px 0;
  color: var(--muted);
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 71px);
  padding: 28px 16px 56px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 30px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.08);
  text-align: center;
}

.auth-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--teal);
  color: #ffffff;
}

.auth-icon svg {
  width: 28px;
  height: 28px;
}

.auth-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.auth-sub {
  margin: 8px 0 22px;
  font-size: 14px;
  color: var(--muted);
}

.field {
  display: block;
  margin-bottom: 14px;
  text-align: left;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 15px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.captcha-row {
  display: flex;
  gap: 8px;
}

.captcha-input {
  flex: 1 1 auto;
  min-width: 0;
}

.captcha-btn {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}

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

.captcha-btn:active {
  transform: scale(0.96);
}

.captcha-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.captcha-img-wrap {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-img {
  display: block;
  width: 180px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
}

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

.auth-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: #991b1b;
  font-size: 13px;
  text-align: left;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.link-btn {
  display: block;
  margin: 14px auto 0;
  padding: 6px 10px;
  border: none;
  background: none;
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
}

.link-btn:hover {
  text-decoration: underline;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.loading-note {
  padding: 44px 0;
  text-align: center;
  color: var(--muted);
}

.game-error {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--red-soft);
  color: #991b1b;
}

.icon-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.verify-modal {
  max-width: 430px;
}

.verify-status {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #7c4a03;
  font-size: 14px;
  text-align: left;
}
.game {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 26px 18px 60px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e6e1;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 0.4s ease;
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.07);
  touch-action: none;
}

.column {
  display: grid;
  grid-auto-rows: minmax(62px, auto);
  gap: 12px;
  align-content: start;
}

.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  padding: 2px 4px 4px;
}

.column-head .icon svg {
  width: 17px;
  height: 17px;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 62px;
  padding: 14px 18px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
  overflow-wrap: anywhere;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.25s ease,
    border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
  will-change: transform;
}

.word-card {
  background: var(--teal-soft);
  border-color: var(--teal-edge);
  color: var(--teal-deep);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
}

.meaning-card {
  background: var(--amber-soft);
  border-color: var(--amber-edge);
  color: #7c4a03;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0;
}

.card:not(.matched):not(.error):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.1);
}

.word-card:not(.matched):not(.error):hover {
  border-color: var(--teal);
}

.meaning-card:not(.matched):not(.error):hover {
  border-color: var(--amber);
}

.card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
  transform: translateY(-2px);
}

.card.success {
  background: var(--green-soft);
  border-color: var(--green);
  color: #0c5136;
  animation: pop-green 0.55s ease;
}

.card.matched {
  background: var(--gray-fill);
  border-color: var(--gray-edge);
  color: var(--gray-text);
  pointer-events: none;
  opacity: 0.8;
  transform: none;
  box-shadow: none;
}

.card.matched::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 2px;
  background: var(--gray-text);
  border-radius: 2px;
  opacity: 0.7;
}

.card.error {
  background: var(--red-soft);
  border-color: var(--red);
  color: #991b1b;
  animation: shake 0.45s ease;
}

@keyframes pop-green {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

.line-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.match-line {
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 10 9;
  animation: dash-move 0.7s linear infinite;
  transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.match-line.success {
  stroke: var(--green);
  stroke-width: 4;
  stroke-dasharray: none;
  animation: none;
}

.match-line.error {
  stroke: var(--red);
  stroke-width: 4;
  stroke-dasharray: none;
  animation: none;
}

@keyframes dash-move {
  to {
    stroke-dashoffset: -19;
  }
}

.fail-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
  pointer-events: none;
  white-space: nowrap;
}

.hint-pop-enter-active,
.hint-pop-leave-active {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hint-pop-enter-from,
.hint-pop-leave-to {
  opacity: 0;
  transform: translateX(-50%) translateY(-6px);
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
}

.modal {
  width: 100%;
  max-width: 430px;
  padding: 34px 30px 30px;
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.modal-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--teal);
  color: #ffffff;
}

.modal-icon svg {
  width: 30px;
  height: 30px;
}

.modal h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0;
}

.modal-sub {
  margin: 8px 0 22px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 8px;
  background: #f4f6f3;
}

.result-item .icon {
  color: var(--teal);
}

.result-item b {
  font-size: 18px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.result-item small {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  padding: 13px 26px;
  border: none;
  border-radius: 10px;
  background: var(--teal);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  transition: background 0.15s ease, transform 0.15s ease;
}

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

.primary-btn:active {
  transform: scale(0.97);
}

.modal-fade-enter-active,
.modal-fade-leave-active {
  transition: opacity 0.22s ease;
}

.modal-fade-enter-from,
.modal-fade-leave-to {
  opacity: 0;
}

.modal-fade-enter-active .modal,
.modal-fade-leave-active .modal {
  transition: transform 0.22s ease;
}

.modal-fade-enter-from .modal,
.modal-fade-leave-to .modal {
  transform: translateY(14px) scale(0.97);
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 16px;
    gap: 14px;
  }

  .user-email {
    max-width: 120px;
  }

  .stats {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    margin-left: 0;
    padding-top: 4px;
    border-top: 1px solid var(--line);
  }

  .stat {
    min-width: 0;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat b {
    font-size: 17px;
  }

  .game {
    padding: 18px 10px 44px;
  }

  .board {
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
  }

  .column {
    gap: 9px;
    grid-auto-rows: minmax(56px, auto);
  }

  .card {
    min-height: 56px;
    padding: 10px 10px;
  }

  .word-card {
    font-size: 17px;
  }

  .meaning-card {
    font-size: 13.5px;
  }
}

@media (max-width: 400px) {
  .brand-text h1 {
    font-size: 17px;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .label-btn {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .board {
    gap: 8px;
    padding: 10px;
  }

  .column {
    gap: 7px;
    grid-auto-rows: minmax(50px, auto);
  }

  .card {
    min-height: 50px;
    padding: 8px 6px;
  }

  .word-card {
    font-size: 15px;
  }

  .meaning-card {
    font-size: 12.5px;
  }
}
