* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 页面切换 */
.page {
  display: none;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.page.active {
  display: block;
}

/* ===== 入口页 ===== */
.entry-box {
  background: #fff;
  border-radius: 16px;
  padding: 48px 32px;
  margin-top: 8vh;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}
.entry-box h1 {
  font-size: 28px;
  color: #4a2d80;
  margin-bottom: 12px;
}
.subtitle {
  color: #777;
  margin-bottom: 32px;
}

/* 选择器 */
.selector-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}
.selector-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.selector-label {
  font-size: 14px;
  color: #888;
  min-width: 36px;
  text-align: right;
}
.option-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: #f5f5fa;
  color: #555;
  border: 1px solid #e2e2ec;
  padding: 8px 18px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover {
  background: #e8e8f3;
}
.chip.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.fullbook-tip {
  margin: 0;
  padding: 8px 18px;
  font-size: 14px;
  color: #764ba2;
  background: #f3f0fb;
  border: 1px dashed #c9bef0;
  border-radius: 18px;
}

.primary-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 12px 36px;
  font-size: 16px;
  border-radius: 28px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.35);
}
.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(102, 126, 234, 0.45);
}
.primary-btn:active {
  transform: translateY(0);
}
.entry-tip {
  margin-top: 28px;
  color: #888;
  font-size: 14px;
  line-height: 1.9;
  text-align: left;
  display: inline-block;
}
.link-btn {
  margin-top: 24px;
  background: none;
  border: none;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover {
  color: #667eea;
}

/* ===== 主页面 ===== */
.stats-bar {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  margin-bottom: 20px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.stat-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #4a2d80;
}
.stats-bar .link-btn {
  margin-top: 0;
  margin-left: auto;
}

.word-area {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.word-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 单词行 */
.word-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.word-item.removing {
  opacity: 0.3;
}
.word-item.unknown-marked {
  background: #fff4f4;
  border-color: #ffcdc9;
}
.word-item.known-marked {
  background: #f4fbf4;
  border-color: #c9e8c9;
}
.play-btn {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.play-btn:hover {
  transform: scale(1.08);
}
.word-text {
  font-size: 20px;
  font-weight: 700;
  color: #2c2c2c;
  min-width: 90px;
}
.word-phonetic {
  color: #aaa;
  font-size: 14px;
  margin-right: 4px;
}
.word-meaning {
  color: #d97706;
  font-size: 15px;
  font-weight: 600;
  margin-left: 6px;
  display: none;
}
.word-meaning.show {
  display: inline;
}
.show-meaning-btn {
  background: #f0f4ff;
  color: #667eea;
  border: 1px solid #d8e0ff;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
}
.show-meaning-btn:hover {
  background: #dde6ff;
}
.dont-know-btn {
  margin-left: auto;
  background: #fff4f4;
  color: #d6544d;
  border: 1px solid #ffcdc9;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.dont-know-btn:hover {
  background: #ffe5e3;
}
.know-btn {
  margin-left: auto;
  background: #f4fbf4;
  color: #2e8b57;
  border: 1px solid #c9e8c9;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  margin-right: 8px;
  transition: background 0.15s;
}
.know-btn:hover {
  background: #e0f3e0;
}

/* 标记选中状态 */
.know-btn.marked {
  background: #2e8b57;
  color: #fff;
  border-color: #2e8b57;
}
.dont-know-btn.marked {
  background: #d6544d;
  color: #fff;
  border-color: #d6544d;
}
/* 两个按钮并排时，"我认识"不要靠右贴齐 */
.word-item .know-btn {
  margin-left: auto;
}
.word-item .know-btn + .dont-know-btn {
  margin-left: 0;
}

/* 操作区 */
.action-bar {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.secondary-btn {
  background: #fff;
  color: #667eea;
  border: 1px solid #d8e0ff;
  padding: 12px 28px;
  font-size: 16px;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.secondary-btn:hover {
  background: #eef2ff;
  transform: translateY(-2px);
}
.secondary-btn:active {
  transform: translateY(0);
}
.empty-tip {
  text-align: center;
  color: #4a2d80;
  font-size: 18px;
  padding: 60px 20px;
}

/* 响应式 */
@media (max-width: 600px) {
  .word-item {
    flex-wrap: wrap;
  }
  .word-text {
    min-width: auto;
  }
  .dont-know-btn {
    margin-left: 0;
  }
  .stats-bar {
    gap: 12px;
  }
  .stat-value {
    font-size: 18px;
  }
}
