* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #00A896;
  --primary-light: #00C4AE;
  --bg: #F4F8F7;
  --text: #17303A;
  --text-secondary: #8AA3A0;
  --card-bg: #FFFFFF;
  --border: #E8F3F1;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-top: 56px;
}

/* 导航栏 */
.navbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 168, 150, 0.2);
}

.nav-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
}

.nav-title {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}

.nav-placeholder {
  width: 40px;
}

/* 页面容器 */
.page-container {
  position: relative;
}

.page {
  padding: 12px 12px 30px;
  animation: fadeIn 0.25s ease;
}

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

/* 首页 - 顶部横幅 */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px;
  padding: 24px 18px 20px;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 168, 150, 0.25);
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hero-sub {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.92;
}

.hero-stats {
  display: flex;
  margin-top: 20px;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
}

.stat-label {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.9;
}

/* 进度卡片 */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.progress-card {
  margin-top: 12px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-title {
  font-size: 15px;
  font-weight: 600;
}

.progress-text {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.progress-bar {
  margin-top: 10px;
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
  transition: width 0.3s;
}

.progress-tip {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* 分类网格 */
.section-title {
  margin: 20px 4px 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.category-card {
  width: 48.5%;
  border-radius: 12px;
  padding: 14px 13px;
  color: #fff;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s;
}

.category-card:active {
  transform: scale(0.97);
}

.category-name {
  font-size: 16px;
  font-weight: 700;
}

.category-en {
  margin-top: 2px;
  font-size: 10px;
  opacity: 0.9;
}

.category-desc {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.95;
}

.category-count {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
}

/* 全部音标入口 */
.all-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-top: 12px;
  background: linear-gradient(135deg, #17303A, #2E4A57);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(23, 48, 58, 0.2);
  transition: transform 0.15s;
}

.all-entry:active {
  transform: scale(0.98);
}

.all-entry-title {
  font-size: 16px;
  font-weight: 700;
}

.all-entry-sub {
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.85;
}

.all-entry-arrow {
  font-size: 26px;
  color: var(--primary-light);
}

/* 全部音标页 */
.all-head {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.all-head-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.all-head-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.all-section {
  margin-top: 16px;
}

.all-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 4px 8px;
}

.all-section-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.all-section-count {
  font-size: 11px;
  color: var(--text-secondary);
}

.all-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.all-phoneme-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.12s, background 0.2s, color 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.all-phoneme-btn:active {
  transform: scale(0.9);
}

.all-phoneme-btn.playing {
  background: var(--primary);
  color: #fff;
  transform: scale(0.92);
  box-shadow: 0 4px 12px rgba(0, 168, 150, 0.4);
}

/* 分类页 */
.category-head {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-head .category-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.category-head .category-en {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.category-head .category-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
}

.phoneme-list {
  margin-top: 12px;
}

.phoneme-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s;
}

.phoneme-item:active {
  transform: scale(0.98);
}

.phoneme-symbol {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  min-width: 70px;
}

.phoneme-info {
  flex: 1;
  margin-left: 12px;
}

.phoneme-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: normal;
}

.badge-voiced {
  background: #E8F5E9;
  color: #2E7D32;
}

.badge-voiceless {
  background: #FFF3E0;
  color: #E65100;
}

.phoneme-example {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.phoneme-arrow {
  font-size: 20px;
  color: #CCC;
}

/* 详情页 */
.main-card {
  padding: 20px 16px;
}

.main-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.symbol-box {
  text-align: center;
}

.big-symbol {
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.play-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 168, 150, 0.3);
  transition: transform 0.15s;
}

.play-dot:active {
  transform: scale(0.92);
}

.tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.tag-kind {
  background: #E3F2FD;
  color: #1565C0;
}

.tag-name {
  background: #F3E5F5;
  color: #7B1FA2;
}

.tag-voiced {
  background: #E8F5E9;
  color: #2E7D32;
}

.tag-voiceless {
  background: #FFF3E0;
  color: #E65100;
}

.section {
  margin-top: 16px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.section-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.tip-section .section-text {
  color: #666;
  background: #FFFDE7;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

/* 示例单词 */
.example-card {
  margin-top: 12px;
}

.example-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.example-item:last-child {
  border-bottom: none;
}

.example-word {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.example-phonetic {
  font-size: 14px;
  color: var(--text-secondary);
  margin-right: 12px;
}

.example-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
}

.example-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

/* 底部导航 */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 8px;
}

.nav-btn {
  background: var(--card-bg);
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s;
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-pos {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  animation: fadeIn 0.2s;
}
