/* ---------- Word list ---------- */
.word-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.empty-hint { color: var(--muted); font-size: 13px; }

.word-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fdfcfb;
}
.word-row .w-hanzi {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 22px;
  font-weight: 700;
  min-width: 46px;
}
.word-row .w-info { flex: 1; min-width: 0; }
.word-row .w-pinyin { color: var(--pinyin-color); font-size: 13px; }
.word-row .w-meaning { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-row .w-actions { display: flex; gap: 6px; }
.word-row .w-actions button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: 6px;
}
.word-row .w-actions button:hover { background: #eee; }

/* ---------- Loc danh sach theo danh muc ---------- */
.list-filter { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.list-filter .field { flex: 1; min-width: 0; margin-bottom: 0; }
.list-count { font-size: 13px; color: var(--muted); white-space: nowrap; padding-bottom: 11px; }
.import-category { margin-bottom: 10px; }

/* ---------- Export box ---------- */
.export-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.export-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* ---------- Preview panel (giong het the Anki that) ---------- */
.preview-hint { font-size: 13px; color: var(--muted); margin-top: -8px; margin-bottom: 18px; }

.flip-wrap { perspective: 1400px; }
.flip-card {
  width: 100%;
  min-height: 380px;
  cursor: pointer;
}
.flip-inner {
  position: relative;
  width: 100%;
  min-height: 380px;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.flip-back { transform: rotateY(180deg); }

.card-surface {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fafafa;
  padding: 24px;
  font-family: "Microsoft YaHei", "Noto Sans SC", "PingFang SC", Arial, sans-serif;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
  overflow-y: auto;
}

.hanzi { font-size: 56px; font-weight: bold; margin-bottom: 8px; word-break: break-word; }
.pinyin { font-size: 22px; color: var(--pinyin-color); margin-bottom: 6px; }
.card-surface hr { border: none; border-top: 1px solid #ccc; margin: 14px 0; width: 100%; }
.meaning { font-size: 24px; font-weight: bold; color: var(--meaning-color); margin-bottom: 8px; }
.example { font-size: 16px; color: #444; margin-bottom: 12px; max-width: 90%; white-space: pre-line; }
/* Cau vi du co pinyin: pinyin nho tren tung chu Han (cung mau thanh), an mac dinh */
.example ruby { ruby-position: over; }
/* An bang co chu 0 + visibility (khong dung display: ruby-text, trinh duyet cu bo qua gia tri nay) */
.example rt { font-size: 0; visibility: hidden; font-weight: 600; }
.example.show-pinyin rt { font-size: 0.7em; visibility: visible; }
.example.show-pinyin { line-height: 2; }
/* Hang nut duoi cau vi du: doc ca cau + an/hien pinyin (nut dang an khong chiem cho) */
.example-tools { display: flex; align-items: center; justify-content: center; gap: 8px; }
.example-tools .toggle-gif-btn,
.example-tools .example-audio-btn { margin-bottom: 10px; }
.example-audio-btn {
  border: none;
  background: #eef2f7;
  color: #2b6cb0;
  font-size: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
}
.example-audio-btn:hover { background: #e2e9f2; }
.example-audio-btn:disabled { cursor: progress; opacity: 0.7; }
.mnemonic img { max-width: 200px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 10px; }

.toggle-gif-btn {
  margin-top: 4px;
  border: none;
  background: #eef2f7;
  color: #2b6cb0;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.toggle-gif-btn:hover { background: #e2e9f2; }

.gif-content { display: none; margin-top: 12px; }
.gif-content.open { display: block; }
.gif-content img { max-width: 180px; border: 1px solid #ddd; border-radius: 8px; }

.audio-btn {
  margin-top: 6px;
  border: none;
  background: #eef2f7;
  color: #2b6cb0;
  font-size: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}
.audio-btn:hover { background: #e2e9f2; }

