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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #f5f5f5;
  color: #1a1a1a;
  height: 100vh;
  overflow: hidden;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  background-color: #f5f5f5;
  z-index: 10;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #0052d9;
}

.app-stats {
  font-size: 13px;
  color: #888;
}

#total-count {
  color: #0052d9;
  font-weight: 600;
  font-size: 15px;
}

.word-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.word-item {
  background-color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.word-item.removing {
  opacity: 0;
  transform: translateX(60px);
}

.word-main {
  flex: 1;
  min-width: 0;
}

.word-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.word-phonetic {
  font-size: 13px;
  color: #888;
  margin-left: 8px;
  font-style: italic;
}

.word-meanings {
  margin-top: 6px;
  font-size: 13px;
  color: #444;
  line-height: 1.6;
}

.word-meaning-item {
  display: flex;
  align-items: baseline;
  margin-bottom: 6px;
}

.word-pos {
  color: #0052d9;
  font-weight: 500;
  flex-shrink: 0;           /* 不压缩，保持词性原文宽度 */
  white-space: nowrap;
  margin-right: 8px;        /* 词性和释义之间固定间距 */
}

.word-meaning-text {
  flex: 1;
  min-width: 0;             /* 允许 flex item 内部正常换行 */
}

.word-actions {
  display: flex;
  align-items: flex-end;
}

.btn-delete {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  color: #666;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-delete:hover:not(:disabled) {
  background-color: #fff1f0;
  border-color: #ffccc7;
  color: #cf1322;
}

.btn-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
  font-size: 14px;
}

.loading-tip {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px;
}

.loading-tip .dot {
  width: 8px;
  height: 8px;
  background-color: #0052d9;
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.loading-tip .dot:nth-child(2) { animation-delay: 0.15s; }
.loading-tip .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* 滚动条 */
.word-list::-webkit-scrollbar { width: 6px; }
.word-list::-webkit-scrollbar-thumb { background-color: #d0d0d0; border-radius: 3px; }
.word-list::-webkit-scrollbar-track { background: transparent; }
