/* 记单词：级别大盘 · 预览 · 卡片消除 · 复盘 */

.wm-page {
  width: min(980px, 94%);
  margin: 0 auto;
  padding: 32px 0 56px;
}

.wm-view { display: none; }
.wm-view.active { display: block; }
.wm-view[hidden] { display: none !important; }

.wm-page-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-align: center;
  margin: 0 0 20px;
}

#wm-view-dashboard.wm-view.active {
  padding-top: 8px;
}

.wm-level-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
}
.wm-level-card:nth-child(1) { grid-column: 1 / 4; }
.wm-level-card:nth-child(2) { grid-column: 4 / 7; }
.wm-level-card:nth-child(3) { grid-column: 1 / 3; }
.wm-level-card:nth-child(4) { grid-column: 3 / 5; }
.wm-level-card:nth-child(5) { grid-column: 5 / 7; }

.wm-level-card {
  position: relative;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(116, 123, 255, 0.1);
  border-radius: 20px;
  padding: 22px 22px 20px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(80, 86, 160, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.wm-level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--lv-accent, var(--accent));
  opacity: 0.95;
}
.wm-level-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--lv-accent, var(--accent));
  opacity: 0.06;
  pointer-events: none;
}
.wm-level-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(80, 86, 160, 0.12);
  border-color: rgba(116, 123, 255, 0.22);
}
.wm-level-card.is-active {
  border-color: color-mix(in srgb, var(--lv-accent, var(--accent)) 45%, transparent);
  box-shadow: 0 12px 36px color-mix(in srgb, var(--lv-accent, var(--accent)) 18%, transparent);
}
.wm-lv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.wm-lv-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--lv-accent, var(--accent));
}
.wm-lv-progress {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.wm-level-card.is-active .wm-lv-progress {
  color: var(--lv-accent, var(--accent));
  background: color-mix(in srgb, var(--lv-accent, var(--accent)) 12%, #fff);
}
.wm-lv-name {
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.wm-lv-count {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
  margin-bottom: auto;
  padding-bottom: 14px;
}
.wm-lv-unit {
  font-size: 0.42em;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 4px;
  vertical-align: 0.12em;
}
.wm-lv-plan {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.5;
}
.wm-level-card.is-active .wm-lv-plan {
  color: #475569;
}

.wm-preview-board {
  background: #fff;
  border: 1px solid rgba(116, 123, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(80, 86, 160, 0.07);
  overflow: hidden;
}
.wm-preview-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.wm-preview-col + .wm-preview-col {
  border-left: 1px solid #eef0f6;
}
.wm-preview-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 12px 14px;
  align-items: start;
  padding: 13px 18px;
  border-bottom: 1px solid #f3f4f8;
}
.wm-preview-col .wm-preview-item:last-child {
  border-bottom: none;
}
.wm-preview-item:hover {
  background: #fafbff;
}
.wm-preview-idx {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  padding-top: 3px;
}
.wm-preview-en {
  min-width: 0;
}
.wm-preview-en .wm-en {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--text-main);
}
.wm-preview-item .wm-ph {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 3px;
}
.wm-preview-item .wm-cn {
  color: #5a5fbf;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.45;
  min-width: 0;
  word-break: break-word;
}

.wm-table-wrap {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: auto;
  max-height: min(62vh, 640px);
  scrollbar-width: thin;
  scrollbar-color: rgb(116, 123, 255) #eef0ff;
}
.wm-table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.wm-table-wrap::-webkit-scrollbar-thumb {
  background: rgb(116, 123, 255);
  border-radius: 8px;
}
.wm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.wm-table th {
  text-align: left;
  font-weight: 700;
  color: #64748b;
  padding: 12px 14px;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border-color);
}
.wm-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.wm-table tr:hover td { background: #f5f6ff; }
.wm-en {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text-main);
}
.wm-ph { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.wm-cn { color: #4f46e5; font-weight: 600; }
.wm-kind {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2ff;
  color: #4338ca;
}
.wm-kind.is-review { background: #ecfeff; color: #0e7490; }
.wm-kind.is-error { background: #fef2f2; color: #b91c1c; }

.wm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}
.wm-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.wm-btn-primary {
  background: var(--accent);
  color: #fff;
}
.wm-btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-hard); }
.wm-btn-ghost {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.wm-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.wm-fab {
  position: sticky;
  bottom: 18px;
  float: right;
  margin-top: 8px;
  z-index: 5;
  box-shadow: 0 10px 24px rgba(116, 123, 255, 0.35);
}

body.wm-practice-on {
  background: #f4f5fb;
}
body.wm-practice-on::after {
  display: none;
}
body.wm-practice-on .main-content {
  overflow: hidden;
  padding-bottom: 0;
  background: #f4f5fb;
}

.wm-page:has(#wm-view-practice.active) {
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}

#wm-view-practice.wm-view.active {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.wm-practice-banner {
  width: min(92vw, 1280px);
  margin: 0 auto 16px;
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  color: #3d4266;
  letter-spacing: 0.02em;
  line-height: 1.2;
  flex-shrink: 0;
}

.wm-practice-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 0 2vw 24px;
}

.wm-grid-wrap {
  --wm-board-w: 56vw;
  --wm-board-h: 44vh;
  --wm-cols: 4;
  --wm-rows: 2;
  width: min(var(--wm-board-w), 92vw);
  height: min(var(--wm-board-h), calc(100% - 8px));
  max-height: calc(100vh - 132px);
  background: #fff;
  border: none;
  border-radius: 28px;
  padding: clamp(14px, 1.6vw, 24px);
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(80, 86, 160, 0.09);
  display: flex;
  transition: width 0.4s ease, height 0.4s ease;
}
.wm-grid-wrap.is-locked {
  pointer-events: none;
}
.wm-grid {
  flex: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--wm-cols, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--wm-rows, 2), minmax(0, 1fr));
  gap: clamp(8px, 1vw, 16px);
}
.wm-card {
  position: relative;
  min-height: 0;
  min-width: 0;
  height: 100%;
  border-radius: 18px;
  border: 1px solid transparent;
  background: #f7f8fc;
  box-shadow: none;
  padding: clamp(8px, 1.1vw, 18px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}
.wm-card.en {
  background: #f4f5fb;
}
.wm-card.cn {
  background: #eef0fb;
}
.wm-card:hover:not(.gone):not(.wrong) {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 10px 28px rgba(90, 96, 170, 0.12);
  border-color: rgba(116, 123, 255, 0.18);
}
.wm-card.selected {
  background: #fff;
  border-color: rgba(116, 123, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(116, 123, 255, 0.16);
  transform: scale(1.03);
}
.wm-card.gone {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  box-shadow: none;
}
.wm-card.wrong {
  animation: wm-shake 0.38s ease;
  border-color: #f0a0a0;
  background: #fff5f5;
}
.wm-card-text {
  font-weight: 600;
  font-size: clamp(9px, calc(15.4vh / var(--wm-rows, 4)), 22px);
  line-height: 1.3;
  color: #1c1d2e;
  word-break: break-word;
  max-width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.wm-card.en .wm-card-text {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #16172a;
  -webkit-line-clamp: 2;
}
.wm-card.cn .wm-card-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(8px, calc(12.6vh / var(--wm-rows, 4)), 17px);
  color: #5a5fbf;
}

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

.wm-round-splash {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.wm-round-splash[hidden] { display: none !important; }
.wm-round-splash-inner {
  font-size: clamp(64px, 15vw, 176px);
  font-weight: 800;
  color: rgba(99, 102, 241, 0.42);
  letter-spacing: 0.04em;
  line-height: 1;
  animation: wm-round-pop 0.35s ease;
  user-select: none;
}
@keyframes wm-round-pop {
  from { transform: scale(0.82); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.wm-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}
.wm-danger-list {
  margin: 8px 0 16px;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #9a3412;
  font-size: 14px;
}

.wm-loading, .wm-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
}

@media (max-width: 720px) {
  .wm-level-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 420px;
  }
  .wm-level-card:nth-child(n) { grid-column: 1 / -1; }
  .wm-level-card { min-height: 0; padding: 18px 18px 16px; }
  .wm-preview-columns { grid-template-columns: 1fr; }
  .wm-preview-col + .wm-preview-col {
    border-left: none;
    border-top: 1px solid #eef0f6;
  }
  .wm-preview-item {
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .wm-preview-item .wm-cn {
    grid-column: 2;
  }
  .wm-actions { justify-content: stretch; }
  .wm-btn { width: 100%; }
  .wm-fab { width: 100%; float: none; }
  .wm-practice-banner {
    font-size: clamp(24px, 7vw, 40px);
    margin-bottom: 12px;
  }
  .wm-grid-wrap {
    width: 94vw;
    height: calc(100vh - 170px);
    border-radius: 18px;
    padding: 10px;
  }
}
