:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --primary: #3b82f6;
  --success: #10b981;
  --text: #1e293b;
  --mask: #e2e8f0;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* 头部导航 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 10px 0;
  z-index: 10;
}
.btn {
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-danger {
  background: #fee2e2;
  color: #ef4444;
  border: 1px solid #fecaca;
  font-size: 12px;
}

/* 列表样式 */
/* 修改首页列表布局 */
.menu-list {
  display: grid;
  /* 核心修改：一行最少放2个，如果屏幕够宽会自动放更多 */
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 10px 0;
}

/* 修改卡片式按钮 */
.menu-item {
  background: var(--card);
  padding: 12px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column; /* 文字上下排 */
  align-items: center; /* 居中 */
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: 0.2s;
}

.menu-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
/* 单词卡片 */
#wordList {
  min-height: 60vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.word-card.active {
  width: 100%;
  max-width: 500px;
  animation: slideIn 0.3s ease-out;
}
.word-card {
  background: var(--card);
  border-radius: 16px;
  padding: 12px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.word-main {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.word-kana {
  font-size: 16px;
  color: #64748b;
  font-weight: normal;
}

/* 蒙版逻辑 */
.detail-box {
  margin-top: 10px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}
.mask-item {
  background: var(--mask);
  color: transparent;
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-block;
  cursor: pointer;
  transition: 0.2s;
  margin-bottom: 8px;
}
.mask-item.show {
  background: transparent;
  color: var(--text);
}
.label {
  font-size: 12px;
  color: #94a3b8;
  display: block;
  margin-bottom: 4px;
}

/* 历史列表 */
.hist-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
}

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

.speaker-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  vertical-align: middle;
}

/* 蒙版组样式 */
.mask-group {
  position: relative;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 15px;
  cursor: pointer;
  min-height: 40px;
}

.mask-content {
  opacity: 0;
  transition: 0.2s;
}
.mask-overlay {
  position: absolute;
  inset: 0;
  background: #cbd5e1; /* 明显的蒙版色 */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-weight: 500;
}

.mask-group.show .mask-content {
  opacity: 1;
}
.mask-group.show .mask-overlay {
  display: none;
}

/* 喇叭按钮 */
.speaker-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.1s;
}
.speaker-btn:active {
  transform: scale(1.2);
}

/* 已学习按钮大而醒目 */
.master-btn {
  width: 100%;
  padding: 18px;
  font-size: 20px;
  margin-top: 20px;
  border-radius: 12px;
}

/* 备份/管理按钮 (实心紫色) */
.btn-data-solid {
  background-color: #8b5cf6;
  color: white;
  font-weight: bold;
  border: none;
}

/* 最近学习按钮 (实心蓝色) */
.btn-primary-solid {
  background-color: #3b82f6;
  color: white;
  font-weight: bold;
  border: none;
}

/* 恢复进度按钮 (实心橙色) */
.btn-recovery-solid {
  background-color: green;
  color: white;
  font-weight: bold;
  border: none;
}

/* warning button*/
.btn-warn-solid {
  background-color: red;
  color: white;
  font-weight: bold;
  border: none;
}

.finish-state {
  text-align: center;
  margin-top: 100px;
}

#backupModal .btn {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}
