* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f2f4fb;
}

/* Layout */
.app {
  display: flex;
  height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

/* Search */
.sidebar input {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  margin-bottom: 10px;
}

/* Back button */
#backBtn {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 10px;
  border: none;
  background: #eef2ff;
  cursor: pointer;
}

/* Lists */
#topicList,
#wordList {
  flex: 1;
  overflow-y: auto;
}

/* Item */
.word-item {
  height: 60px;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.word-item:hover {
  background: #eef2ff;
}

.word-item.active {
  background: #dbe4ff;
}

.scroll-hint {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-top: 6px;
}

/* Content */
.content {
  flex: 1;
}

/* Card */
.card {
  background: white;
  height: 100%;
  border-radius: 20px;
  padding: 28px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.placeholder {
  color: #888;
}

/* Word header */
.word-title {
  font-size: 34px;
  font-weight: 600;
}

.pronunciation {
  font-size: 18px;
  color: #666;
  margin-left: 8px;
}

.audio-btn {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: #4f6ef7;
  color: white;
  cursor: pointer;
}

/* Meanings */
.meanings {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.meaning-box {
  flex: 1;
  background: #f7f8fe;
  padding: 16px;
  border-radius: 14px;
}

/* Toggle */
.toggle {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.toggle-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
}

.toggle-btn.active {
  background: #4f6ef7;
  color: white;
}

/* Sentences */
.sentences {
  margin-top: 28px;
}

.sentences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.sentence-card {
  background: linear-gradient(135deg, #f9faff, #eef2ff);
  padding: 16px;
  border-radius: 16px;
  line-height: 1.6;
}

.highlight {
  background: #fff3b0;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

/* Mobile */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
  }

  #wordList,
  #topicList {
    max-height: 180px;
  }

  .meanings {
    flex-direction: column;
  }
}
