/* --- HERO --- */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  padding: 0 20px;
  overflow: hidden;
}
#myVideo {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 100%;
  min-height: 100%;
  z-index: -2;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
  z-index: -1;
}
#hero h1 {
  font-size: 4rem;
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  letter-spacing: -1px;
}
#hero p {
  font-size: 1.2rem;
  margin: 0 auto 30px auto;
  max-width: 800px;
  opacity: 0.9;
}
.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- FEATURES --- */
#why-choose-us {
  padding: 80px 10%;
  background: white;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
.feature-item {
  text-align: center;
  perspective: 1000px;
  /* [v7.53 FIX] height tường minh thay min-height — height:100% của con chỉ
     resolve được từ explicit height, không resolve từ min-height */
  height: 280px;
  cursor: pointer;
  background: transparent;
}
.feature-item-inner {
  position: relative;
  width: 100%;
  height: 100%; /* giờ resolve đúng = 280px */
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}
.feature-item:hover .feature-item-inner {
  transform: rotateY(180deg);
}
.feature-front, .feature-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-card);
}
.feature-front {
  background: #fff;
  border: 1px solid #f0f0f0;
}
.feature-back {
  background: linear-gradient(135deg, var(--dark-red) 0%, var(--primary-red) 100%);
  transform: rotateY(180deg);
  border: none;
  box-shadow: 0 15px 30px rgba(211, 47, 47, 0.3);
}

.feature-icon {
  width: 70px;
  height: 70px;
  background: #ffebee;
  color: var(--primary-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 20px;
  transition: 0.3s;
}
.feature-front:hover .feature-icon {
  transform: scale(1.1);
}
.feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #333;
}
.feature-desc {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Số liệu Mặt Sau: Màu Vàng Gold nổi bật trên nền Đỏ */
.feature-back h3 {
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--accent-gold);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Chữ mô tả Mặt Sau: Màu trắng rõ nét */
.feature-back p {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- COURSES --- */
#courses {
  padding: 80px 10%;
  background: var(--bg-gray);
}
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-weight: 700;
  position: relative;
  display: inline-block;
  width: 100%;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}
.course-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: none;
  transition: all 0.4s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.course-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}
.card-img {
  height: 220px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}
.course-card:hover .card-img img {
  transform: scale(1.1);
}
.course-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: 0.3s;
}
.course-card:hover .course-overlay {
  opacity: 1;
}
.card-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}
.tag {
  background: #e3f2fd;
  color: #1565c0;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 10px;
  width: fit-content;
}
.course-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #333;
}
.course-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 15px;
}
.price {
  color: var(--primary-red);
  font-weight: 800;
  font-size: 1.3rem;
  display: block;
  margin-bottom: 15px;
}
.card-content .btn-red {
  width: 100%;
  box-shadow: none;
  margin-top: auto;
}

/* Student Corner */
#student-corner {
  padding: 80px 10%;
  background: #fff;
  border-top: 1px solid #eee;
}
.corner-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-weight: 700;
  position: relative;
}
.corner-subtitle {
  text-align: center;
  margin-bottom: 50px;
  color: var(--text-light);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}
.gallery-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: 0.4s;
  background: #000;
  cursor: pointer;
  border: 4px solid white;
}
.gallery-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(211, 47, 47, 0.2);
}
.gallery-item::after {
  content: "© Yếu TiếngTrung";
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
}
.gallery-media {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
  transition: 0.5s;
  opacity: 0.95;
}
.gallery-item:hover .gallery-media {
  transform: scale(1.05);
  opacity: 1;
}

/* --- FORM ĐĂNG KÝ GỌN GÀNG (FILE: pages.css) --- */
#register {
  padding: 60px 5%;
  background-color: #f4f6f8; /* Nền xám nhẹ tách biệt */
  display: flex;
  justify-content: center;
  position: relative;
  margin-bottom: 0;
  z-index: 1;
}

/* XÓA BỎ LỚP NỀN TRẮNG CŨ GÂY RỐI MẮT */
#register::before {
  display: none !important;
}

.form-box {
  background: white;
  padding: 40px;
  border-radius: 15px;
  max-width: 700px;
  width: 100%;
  text-align: center;
  /* Tạo bóng nhẹ cho nổi bật */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
  border: 1px solid #eee;
}
/* --- NEWS & QUIZ --- */
#news {
  padding: 80px 5%;
  background: #fdfdfd;
  border-top: 1px solid #eee;
  overflow: hidden;
}
.news-slider-wrapper {
  position: relative;
  margin-top: 40px;
}
.news-track-container {
  overflow: hidden;
  width: 100%;
  padding: 10px 0 30px;
}
.news-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  gap: 20px;
}
.news-card {
  min-width: calc(25% - 15px);
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: none;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: 0.3s;
}
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.news-img {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #eee;
}
.news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}
.news-card:hover .news-img img {
  transform: scale(1.1);
}
.news-date {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-red);
  color: white;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: bold;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.news-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.news-category {
  color: var(--primary-red);
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.news-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}
.read-more-link {
  margin-top: auto;
  color: var(--primary-red);
  font-weight: bold;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.read-more-link:hover {
  text-decoration: underline;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-dark);
  transition: 0.3s;
}
.slider-btn:hover {
  background: var(--primary-red);
  color: white;
  box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3);
}
.prev-btn {
  left: -20px;
}
.next-btn {
  right: -20px;
}
.bonus-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, var(--accent-gold), #ffa500);
  color: var(--dark-red);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  z-index: 5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
  animation: pulseBadge 2s infinite;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
.news-alert-box {
  background: #e3f2fd;
  color: #1565c0;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: bold;
  border: 1px dashed #2196f3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: fadeIn 0.5s ease;
}

/* Quiz Modal Content */
#quizModal .auth-box {
  max-width: 1000px;
  padding: 0;
  background: #fdfdfd;
  height: 90vh;
  display: flex;
  flex-direction: column;
}
.quiz-pro-header {
  background: white;
  padding: 15px 30px;
  border-bottom: 2px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.quiz-timer-box {
  background: #ffebee;
  color: var(--primary-red);
  font-weight: 800;
  font-size: 1.2rem;
  padding: 8px 20px;
  border-radius: 30px;
  border: 2px solid var(--primary-red);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pulseRed 2s infinite;
}
#quiz-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  scroll-behavior: smooth;
}
.question-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  transition: 0.3s;
}
.question-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-3px);
}
.q-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: white;
}
.q-text {
  font-size: 1.1rem;
  color: #333;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.6;
}
.custom-audio {
  width: 100%;
  background: #f1f3f4;
  border-radius: 30px;
  margin-bottom: 15px;
  height: 40px;
  outline: none;
}
.q-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.q-option-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 15px;
  border: 2px solid #eee;
  border-radius: 10px;
  transition: 0.2s;
  font-weight: 500;
  color: #555;
}
.q-option-label:hover {
  background: #fffde7;
  border-color: var(--accent-gold);
}
.q-option-label input {
  margin-right: 10px;
  transform: scale(1.3);
  accent-color: var(--primary-red);
}
.q-option-label.selected-answer {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1565c0;
}

.quiz-result-container {
  text-align: center;
  padding: 30px;
  animation: zoomIn 0.5s ease;
  background: #fff url("https://www.transparenttextures.com/patterns/cubes.png");
  position: relative;
  height: 100%;
  overflow-y: auto;
}
.score-box-final {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffebee);
  border: 5px solid var(--primary-red);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px rgba(211, 47, 47, 0.3);
  position: relative;
  z-index: 10;
}
.score-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary-red);
  line-height: 1;
}
.score-total {
  font-size: 1rem;
  color: #999;
  font-weight: bold;
}
.result-rank {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.result-msg {
  color: #555;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.6;
}
.recommend-course-box {
  background: #fff;
  border: 2px dashed var(--accent-gold);
  border-radius: 15px;
  padding: 20px;
  max-width: 500px;
  margin: 0 auto 30px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  text-align: left;
}
.recommend-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-gold);
  color: var(--dark-red);
  padding: 5px 15px;
  border-radius: 0 0 0 15px;
  font-weight: bold;
  font-size: 0.8rem;
}
.rec-title {
  color: var(--primary-red);
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 5px;
}
.rec-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 15px;
}
.result-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}
#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* News Popup & Detail Content */
.news-popup-content,
.all-news-content {
  background: white;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  position: relative;
  padding: 20px;
  display: flex;
  flex-direction: column;
  animation: zoomIn 0.3s ease;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.popup-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.popup-title {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 15px;
  line-height: 1.3;
  font-weight: 700;
}
.popup-meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 25px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  font-style: italic;
}
.popup-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  text-align: justify;
}
.popup-body h3 {
  margin-top: 30px;
  margin-bottom: 15px;
  color: #222;
  border-left: 5px solid var(--primary-red);
  padding-left: 15px;
  font-size: 1.5rem;
  background: #fff5f5;
  padding: 10px 15px;
  border-radius: 0 10px 10px 0;
}
.all-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
  margin-top: 25px;
}
.detail-content {
  background: white;
  width: 95%;
  max-width: 900px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.4s ease;
  margin-bottom: 50px;
}
.sale-banner {
  background: linear-gradient(135deg, var(--dark-red), var(--primary-red));
  color: white;
  padding: 60px 20px 40px;
  text-align: center;
  position: relative;
}
.sale-banner h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.timer-box {
  margin: 20px 0;
}
.countdown {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}
.countdown div {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: bold;
  min-width: 70px;
}
.countdown span {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-gold);
}
.price-box {
  margin: 20px 0;
}
.old-price {
  text-decoration: line-through;
  opacity: 0.8;
  font-size: 1.1rem;
  margin-right: 15px;
  color: #ffcdd2;
}
.new-price {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.btn-sale {
  background: var(--accent-gold);
  color: var(--dark-red);
  padding: 15px 50px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 1.2rem;
  display: inline-block;
  box-shadow: 0 0 20px rgba(251, 192, 45, 0.6);
  animation: pulseBtn 1.5s infinite;
  border: 3px solid white;
}
.course-info-body {
  padding: 40px;
  color: #333;
  line-height: 1.6;
}
.info-section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 40px 0 20px;
  text-transform: uppercase;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}
.benefit-box {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  position: relative;
  background: #fff;
  transition: 0.3s;
  display: flex;
  gap: 15px;
  align-items: flex-start;
}
.benefit-box:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  border-color: var(--primary-red);
  transform: translateY(-3px);
}
.benefit-num {
  background: var(--primary-dark);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.curriculum-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}
.curri-item {
  background: #fff5f5;
  padding: 15px;
  border-radius: 8px;
  border-left: 5px solid var(--primary-red);
  display: flex;
  align-items: center;
  gap: 15px;
}
.curri-icon {
  font-size: 1.5rem;
  color: var(--primary-red);
}
.commit-box {
  background: var(--primary-gradient);
  color: white;
  padding: 30px;
  border-radius: 15px;
  margin-top: 30px;
}
.commit-item {
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
}
.commit-item:last-child {
  border-bottom: none;
}
.commit-title {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Exit Intent */
.exit-popup-content {
  background: linear-gradient(135deg, #fff, #fff5f5);
  width: 90%;
  max-width: 500px;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 4px solid var(--primary-red);
  animation: zoomIn 0.4s ease;
}
.exit-gift-icon {
  font-size: 60px;
  margin-bottom: 10px;
  display: block;
  animation: floatGift 2s infinite ease-in-out;
}
@keyframes floatGift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Reviews */
#community-reviews {
  padding: 80px 10%;
  background: linear-gradient(to bottom, #fff, #f9f9f9);
}
.review-container {
  max-width: 900px;
  margin: 0 auto;
}
.review-box-wrapper {
  background: white;
  border: none;
  padding: 40px;
  border-radius: 20px;
  margin-bottom: 50px;
  box-shadow: var(--shadow-card);
}
.cmt-item {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}
.cmt-user-info {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
}
.cmt-avatar-frame {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
}
.cmt-meta {
  flex: 1;
}
.cmt-name {
  font-weight: bold;
  color: #333;
  font-size: 0.95rem;
}
.cmt-rank {
  font-size: 0.7rem;
  background: #e3f2fd;
  color: #1565c0;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 5px;
  font-weight: bold;
}
.cmt-time {
  font-size: 0.75rem;
  color: #999;
  display: block;
}
.cmt-content {
  color: #444;
  line-height: 1.5;
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.cmt-actions {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.cmt-btn {
  cursor: pointer;
  transition: 0.2s;
}
.cmt-btn:hover {
  color: var(--primary-red);
}
.cmt-btn.active {
  color: #e91e63;
  font-weight: bold;
}
.reply-box {
  margin-top: 15px;
  padding-left: 20px;
  border-left: 3px solid #eee;
  display: none;
}
.reply-item {
  background: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 0.9rem;
}
.reply-input-wrapper {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}
.reply-input-wrapper input {
  flex: 1;
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
}

/* =============================================
   CHỈNH SỬA HIỂN THỊ ẢNH (BANNER TO - ẢNH CON NHỎ)
   ============================================= */

/* 1. Cấu hình cho ẢNH CHÍNH (Banner đầu bài) - Luôn Full chiều ngang */
img.popup-img {
  width: 100% !important; /* Bắt buộc rộng 100% */
  max-width: 100% !important; /* Không bị giới hạn kích thước */
  height: auto !important; /* Tự động chỉnh chiều cao theo tỷ lệ */
  max-height: 400px; /* Giới hạn chiều cao để không chiếm hết màn hình */
  object-fit: cover !important; /* Cắt ảnh đẹp, không bị méo */
  margin: 0 0 25px 0 !important; /* Khoảng cách dưới */
  border-radius: 15px 15px 0 0; /* Bo cong 2 góc trên */
  box-shadow: none !important; /* Bỏ bóng mờ của banner nếu không cần */
}

/* 2. Cấu hình cho ẢNH PHỤ (Trong nội dung bài viết) - Thu nhỏ gọn gàng */
/* Chỉ tác động vào ảnh nằm trong khối nội dung (.popup-body) */
.popup-body img,
.article-content img,
.popup-body figure img {
  max-width: 60% !important; /* Ảnh con chỉ rộng 60% */
  height: auto !important;
  display: block !important;
  margin: 25px auto !important; /* Căn giữa */

  /* Trang trí cho ảnh con */
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 2px solid #fff;
}

/* 3. Chế độ Mobile (Điện thoại) */
@media (max-width: 768px) {
  /* Trên điện thoại thì ảnh con cũng cho to ra để dễ nhìn */
  .popup-body img,
  .article-content img,
  .popup-body figure img {
    max-width: 100% !important;
  }

  img.popup-img {
    height: 250px !important; /* Giảm chiều cao banner trên điện thoại */
  }
}
/* =============================================
   CSS CÔNG CỤ TÍNH LƯƠNG (SALARY CALCULATOR)
   ============================================= */
.salary-calculator-container {
  display: flex;
  gap: 40px;
  max-width: 1000px;
  margin: 40px auto 0;
  align-items: stretch;
}

/* Khung nhập liệu (Bên trái) */
.salary-input-box {
  flex: 1;
  background: #f9f9f9;
  padding: 30px;
  border-radius: 15px;
  border: 1px solid #eee;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #555;
  font-size: 0.9rem;
}

.calc-select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  background: white;
  transition: 0.3s;
}

.calc-select:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* Khung kết quả (Bên phải) */
.salary-result-box,
.salary-placeholder {
  flex: 1.2;
  padding: 30px;
  border-radius: 15px;
  background: white;
  border: 2px dashed #ddd;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.salary-result-box {
  border: 2px solid var(--accent-gold);
  background: #fffde7; /* Nền vàng nhạt */
  animation: fadeIn 0.5s ease;
  color: #333; /* Fix lỗi chữ trắng */
}

.result-header {
  text-align: center;
  text-transform: uppercase;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.salary-number {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-red);
  margin-bottom: 25px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.insight-item {
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.6);
  padding: 10px;
  border-radius: 8px;
}

.insight-advice {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--primary-red);
  font-size: 0.95rem;
  line-height: 1.5;
  color: #333;
}

.salary-placeholder {
  text-align: center;
  align-items: center;
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .salary-calculator-container {
    flex-direction: column;
  }
  .salary-number {
    font-size: 1.8rem;
  }
}

/* Dictionary */
.dict-box {
  border-radius: 15px;
}
.dict-suggest-box {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 5px;
  display: none;
}
.dict-suggest-item {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dict-suggest-item:hover {
  background: #fff5f5;
  border-left: 4px solid var(--primary-red);
  padding-left: 16px;
}
.dict-suggest-item .hz {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary-dark);
}
.dict-suggest-item .py {
  color: var(--text-light);
  font-size: 0.9rem;
  font-family: monospace;
}
.dict-header {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
  border-bottom: 2px dashed #eee;
  padding-bottom: 20px;
  align-items: flex-start;
}
.dict-meta h3 {
  margin: 0 0 10px 0;
  font-size: 2rem;
  color: #333;
  line-height: 1.2;
}
.dict-tags {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.dict-tag {
  background: #e3f2fd;
  color: #1565c0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}
.dict-tag.hsk {
  background: color-mix(in srgb, var(--primary-red, #c62828) 10%, transparent);
  color: var(--primary-dark, #c62828);
}
.dict-tag.pos {
  background: #e8f5e9;
  color: #2e7d32;
}
.dict-meaning {
  font-size: 1.15rem;
  color: #444;
  line-height: 1.6;
}
.dict-audio-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* =============================================
   SPEAKER PLAYING ANIMATION (Micro-interaction)
   ============================================= */
.speak-btn.playing,
.play-audio-btn.playing,
.xianxia-tts-btn.playing {
  color: var(--primary-red, #d32f2f) !important;
  animation: dictSpeakerPulse 1s ease-in-out infinite;
  position: relative;
}
.speak-btn.playing::before,
.play-audio-btn.playing::before,
.xianxia-tts-btn.playing::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 47, 47, 0.25) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(1);
  animation: dictSpeakerRipple 1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes dictSpeakerPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}
@keyframes dictSpeakerRipple {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}
body.dark-mode .speak-btn.playing,
body.dark-mode .play-audio-btn.playing,
body.dark-mode .xianxia-tts-btn.playing {
  color: #ff5252 !important;
}
body.dark-mode .speak-btn.playing::before,
body.dark-mode .play-audio-btn.playing::before,
body.dark-mode .xianxia-tts-btn.playing::before {
  background: radial-gradient(circle, rgba(255, 82, 82, 0.3) 0%, transparent 70%);
}
.dict-section-title {
  font-size: 1.2rem;
  color: var(--primary-dark);
  border-left: 4px solid var(--accent-gold);
  padding-left: 10px;
  margin: 25px 0 15px;
  font-weight: bold;
}
.dict-examples {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dict-examples li {
  background: #f9f9f9;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 3px solid #ddd;
}
.dict-ex-zh {
  font-size: 1.15rem;
  color: #333;
  margin-bottom: 5px;
}
.stroke-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.stroke-box {
  width: 100px;
  height: 100px;
  background: url("https://cdn.jsdelivr.net/npm/hanzi-writer@3.5/dist/bg.png")
    no-repeat center center;
  background-size: cover;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
}
.dict-ex-card {
  background: #fafafa;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid #ccc;
}
.btn-read-more {
  background: none;
  border: 1px dashed #2196f3;
  color: #2196f3;
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}
.rel-tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}
.rel-tag {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.95rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.rel-tag:hover {
  transform: translateY(-1px);
}
.rel-tag.anti {
  background: color-mix(in srgb, var(--primary-red, #c62828) 10%, transparent);
  color: var(--primary-dark, #c62828);
  border: 1px solid color-mix(in srgb, var(--primary-red, #c62828) 20%, transparent);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.rel-tag.anti:hover {
  background: #ffcdd2;
  transform: translateY(-1px);
}
.rel-tag.syn {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.rel-tag.syn:hover {
  background: #c8e6c9;
  transform: translateY(-1px);
}
.comp-details {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.comp-summary {
  background: #ffecb3;
  padding: 12px 15px;
  cursor: pointer;
  font-weight: bold;
  color: #e65100;
  list-style: none;
  outline: none;
}
.comp-summary::-webkit-details-marker {
  display: none;
}
.comp-content {
  padding: 15px;
  background: white;
  border-top: 1px solid #ffe082;
  font-size: 0.95rem;
  line-height: 1.6;
}
/* =============================================
   CLICK-TO-ANIMATE WORD HEADER STROKES
   ============================================= */

/* Main word container — flexbox column for Simplified/Traditional rows */
.dict-main-word {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.dict-word-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.dict-word-trad-row {
  margin-top: 2px;
}

/* Clickable character spans in the main word header */
.dict-char-clickable {
  cursor: pointer !important;
  display: inline-block;
  min-width: 44px;
  min-height: 44px;
  text-align: center;
  transition: all 0.25s ease;
  border-radius: 8px;
  padding: 2px 4px;
  position: relative;
}
.dict-char-clickable:hover {
  background: rgba(211, 47, 47, 0.08);
  opacity: 0.8;
  transform: scale(1.05);
}
.dict-char-clickable:active {
  transform: scale(0.97);
}
.dict-char-clickable.dict-char-active {
  background: rgba(211, 47, 47, 0.12);
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.3);
}
/* Subtle underline hint that chars are clickable */
.dict-char-clickable::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--primary-red);
  opacity: 0.25;
  border-radius: 2px;
  transition: opacity 0.3s;
}
.dict-char-clickable:hover::after {
  opacity: 0.6;
}

/* Traditional character color — WCAG AA (5.2:1 vs #1a1a1a) */
.dict-trad-char {
  color: #888;
  font-size: 0.7em;
}
body.dark-mode .dict-trad-char {
  color: #E57373 !important;
}

/* Floating stroke animation panel */
.dict-stroke-float {
  margin-top: 15px;
  padding: 15px 20px;
  border-radius: 12px;
  border: 2px solid rgba(211, 47, 47, 0.3);
  background: var(--bg-gray);
  animation: dictStrokeSlideIn 0.3s ease;
}
@keyframes dictStrokeSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
body.dark-mode .dict-stroke-float {
  background: #1e1e24;
  border-color: rgba(255, 82, 82, 0.3);
}

/* Force stroke box to ALWAYS have white background for contrast */
#dict-stroke-active-box,
.dict-stroke-float #dict-stroke-active-box,
body.dark-mode .dict-stroke-float #dict-stroke-active-box {
  background: #ffffff !important;
  background-color: #ffffff !important;
}
/* Ensure HanziWriter SVG paths are visible on the white background */
#dict-stroke-canvas svg {
  background: #ffffff !important;
}

/* Mobile: floating panel full width */
/* [v7.47 FIX] Bỏ width/height !important — JS (dictionary.js) tự tính strokeSize
   từ canvas.offsetWidth nên CSS override gây xung đột: box=100px nhưng SVG=150px */
@media (max-width: 768px) {
  .dict-stroke-float {
    padding: 12px;
  }
}

/* ============================================================
   FEEDBACK SECTION (Cảm nhận học viên — Inspired by DOL English)
   ============================================================ */
.feedback-section {
  padding: 80px 8%;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

/* === Inline Badge (replaces old bulky counter) === */
.feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #fff8e1, #fff3e0);
  color: #e65100;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid #ffe0b2;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}

.feedback-badge i {
  color: #ffa000;
  font-size: 0.7rem;
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* === Individual Feedback Card === */
.feedback-card {
  background: white;
  border-radius: 16px;
  padding: 28px 24px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  display: flex;
  flex-direction: column;
}

.feedback-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
  border-color: #ddd;
}

.fb-quote-icon {
  font-size: 3.5rem;
  line-height: 1;
  color: #e0e0e0;
  font-family: Georgia, serif;
  position: absolute;
  top: 12px;
  left: 20px;
  pointer-events: none;
}

.fb-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.fb-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #f0f0f0;
}

.fb-user-info {
  flex: 1;
  min-width: 0;
}

.fb-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark, #333);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fb-date {
  font-size: 0.78rem;
  color: #999;
}

/* === Verified Badge === */
.fb-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid #c8e6c9;
  white-space: nowrap;
}

.fb-verified i {
  font-size: 0.65rem;
}

.fb-platform-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.feedback-card:hover .fb-platform-icon {
  opacity: 1;
}

.fb-content {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.fb-post-image {
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  max-height: 140px;
}

.fb-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.feedback-card:hover .fb-post-image img {
  transform: scale(1.03);
}

.fb-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #f5f5f5;
  padding-top: 12px;
  margin-top: auto;
  min-height: 20px;
}

.fb-review-link {
  font-size: 0.82rem;
  color: var(--primary-red);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
  white-space: nowrap;
}

.fb-review-link:hover {
  color: var(--dark-red);
  text-decoration: underline;
}

.fb-review-link i {
  margin-right: 4px;
  font-size: 0.7rem;
}

/* === Admin Edit Button (on each card) === */
.fb-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.3s;
  z-index: 5;
}

.fb-edit-btn:hover {
  background: var(--primary-red);
  color: white;
  transform: scale(1.1);
}

/* === Admin FAB Button — Bottom LEFT (Industry standard: chat=right, settings=left) === */
.admin-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;       /* ← LEFT: tránh xung đột với Chat FAB (right) */
  right: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f5a623;
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245,166,35,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.3s;
  opacity: 0.85;
}

.admin-fab:hover {
  transform: scale(1.1) rotate(90deg);
  opacity: 1;
  box-shadow: 0 6px 20px rgba(245,166,35,0.5);
}

/* === "Xem tất cả" Button === */
.btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  border: 2px solid var(--primary-dark);
  border-radius: 50px;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.35s ease;
  background: transparent;
}

.btn-view-all:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   ADMIN FEEDBACK MODAL
   ============================================================ */
.fb-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fb-modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  animation: fbModalSlideIn 0.35s ease;
}

@keyframes fbModalSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.fb-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.fb-modal-header h3 i {
  margin-right: 8px;
  color: var(--primary-red);
}

.fb-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  color: #666;
}

.fb-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

.fb-modal-body {
  padding: 20px 24px;
}

.fb-form-group {
  margin-bottom: 18px;
}

.fb-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.fb-form-group input,
.fb-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: border-color 0.3s;
  font-family: inherit;
  box-sizing: border-box;
}

.fb-form-group input:focus,
.fb-form-group textarea:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.08);
}

/* Platform Picker */
.fb-platform-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fb-platform-option {
  cursor: pointer;
}

.fb-platform-option input {
  display: none;
}

.fb-platform-option span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 25px;
  border: 1.5px solid #e0e0e0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  transition: all 0.3s;
  background: white;
}

.fb-platform-option input:checked + span {
  border-color: var(--primary-red);
  background: #fff5f5;
  color: var(--primary-red);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.15);
}

/* Toggle Switch */
.fb-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.fb-switch input { display: none; }

.fb-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 26px;
  cursor: pointer;
  transition: 0.3s;
}

.fb-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.fb-switch input:checked + .fb-slider {
  background: #4caf50;
}

.fb-switch input:checked + .fb-slider::before {
  transform: translateX(22px);
}

/* Preview Card */
.fb-preview-card {
  background: #fafafa;
  border: 1px dashed #ddd;
  border-radius: 12px;
  padding: 15px;
  min-height: 60px;
}

/* Modal Footer */
.fb-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
}

.fb-btn-save {
  padding: 10px 24px;
  background: var(--primary-red);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fb-btn-save:hover {
  background: var(--dark-red, #b71c1c);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.fb-btn-cancel {
  padding: 10px 20px;
  background: #f5f5f5;
  color: #666;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.fb-btn-cancel:hover {
  background: #e0e0e0;
}

.fb-btn-delete {
  padding: 10px 18px;
  background: color-mix(in srgb, var(--primary-red, #c62828) 10%, transparent);
  color: var(--primary-dark, #c62828);
  border: 1px solid color-mix(in srgb, var(--primary-red, #c62828) 20%, transparent);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fb-btn-delete:hover {
  background: var(--primary-dark, #c62828);
  color: white;
  border-color: var(--primary-dark, #c62828);
}

/* === Responsive === */
@media (max-width: 1024px) {
  .feedback-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .feedback-section {
    padding: 60px 5%;
  }
  .feedback-header {
    text-align: center;
  }
  .feedback-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .feedback-card {
    padding: 22px 18px 16px;
  }
  .fb-modal-content {
    max-height: 85vh;
    border-radius: 16px;
  }
  .admin-fab {
    bottom: 20px;
    left: 16px;
    right: auto;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    opacity: 0.75;
  }
}

/* ============================================================
   COUNTDOWN TIMER UPGRADE (Component 2 CSS)
   ============================================================ */
.countdown span {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-shadow: 0 0 12px rgba(251, 192, 45, 0.4);
  animation: countdownGlow 2s ease-in-out infinite;
}

@keyframes countdownGlow {
  0%, 100% { text-shadow: 0 0 12px rgba(251, 192, 45, 0.4); }
  50% { text-shadow: 0 0 20px rgba(251, 192, 45, 0.7), 0 0 40px rgba(251, 192, 45, 0.2); }
}

.countdown div {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: bold;
  min-width: 75px;
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease;
}

.countdown div:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.18);
}

/* ===================================================
   FRONTEND REDESIGN — COMMENT ISOLATION + SAVE + LOAD MORE
   =================================================== */

/* COMMENT ITEM — Isolate repaint per comment */
.dict-cmt-item {
  contain: layout style;
  isolation: isolate;
}

/* ═══════════════════════════════════════════════
   WORD CARD — Material Design inspired container
   ═══════════════════════════════════════════════ */
.dict-word-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Header: Hán tự + Speaker/Save trên 1 hàng */
.dict-word-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap !important;
  width: 100%;
}
.dict-word-card__header .dict-main-word {
  flex-shrink: 0;
}
.dict-word-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dict-word-card__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}
/* Icon buttons (speaker + bookmark) */
.dict-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-dark);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.dict-icon-btn:hover {
  background: rgba(211,47,47,0.08);
  border-color: var(--primary-red);
  color: var(--primary-red);
  transform: scale(1.08);
}
.dict-icon-btn:active { transform: scale(0.92); }
.dict-icon-btn--speak {
  color: var(--primary-red);
  border-color: rgba(211,47,47,0.3);
  background: rgba(211,47,47,0.06);
}
.dict-icon-btn--speak:hover {
  background: rgba(211,47,47,0.15);
  box-shadow: 0 3px 12px rgba(211,47,47,0.25);
}

/* Save button — inherits .dict-icon-btn, add specifics */
#dict-save-btn {
  color: var(--primary-red, #d32f2f);
  border-color: rgba(211, 47, 47, 0.3);
}
#dict-save-btn i { transition: transform 0.25s ease; }
#dict-save-btn:hover i { transform: scale(1.15); }
#dict-save-btn.saved {
  background: rgba(211, 47, 47, 0.12);
  border-color: var(--primary-red, #d32f2f);
}
#dict-save-btn.saved i {
  animation: dictSavePop 0.35s cubic-bezier(.36,.07,.19,.97);
}
@keyframes dictSavePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4) rotate(-8deg); }
  70%  { transform: scale(0.9) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Badges row (HSK + radical + lookup count) */
.dict-word-card__badges {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 4px 0;
}
.dict-badge-sep {
  color: rgba(255,255,255,0.25);
  font-weight: 700;
  font-size: 1rem;
  user-select: none;
}
.dict-radical-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-red);
  background: rgba(211,47,47,0.06);
  border: 1px solid rgba(211,47,47,0.15);
  border-radius: 20px;
  padding: 3px 10px;
}
.dict-lookup-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #e65100;
  padding-left: 2px;
}

/* ═══════════════════════════════════════════════
   ACTION BAR — Premium Glassmorphism Chip Strip
   ═══════════════════════════════════════════════ */
.dict-action-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 6px 0 6px 0;
  padding-right: 16px; /* [v7.37] Đảm bảo chip cuối không bị clipped */
  /* [v7.37 FIX BUG 1] Bỏ mask-image: vùng masked không nhận pointer events
     trên mobile → "Báo lỗi" không bấm được */
}
.dict-action-bar::-webkit-scrollbar { display: none; }

.dict-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
}
/* Subtle inner glow on hover */
.dict-action-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: radial-gradient(circle at center, rgba(211,47,47,0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.dict-action-chip:hover::before { opacity: 1; }

.dict-action-chip:hover {
  background: rgba(211,47,47,0.1);
  border-color: rgba(211,47,47,0.4);
  color: #ff6b6b;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(211,47,47,0.2), 0 0 0 1px rgba(211,47,47,0.1);
}
.dict-action-chip:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 1px 4px rgba(211,47,47,0.15);
}
.dict-action-chip i {
  font-size: 0.85rem;
  opacity: 0.7;
  transition: all 0.25s ease;
}
.dict-action-chip:hover i {
  opacity: 1;
  transform: scale(1.15);
}
/* Report chip — orange accent */
.dict-action-chip--report {
  color: var(--text-light);
  border-color: transparent;
  background: transparent;
}
.dict-action-chip--report::before {
  background: radial-gradient(circle at center, rgba(239,108,0,0.12), transparent 70%);
}
.dict-action-chip--report:hover {
  color: #ffab40;
  border-color: rgba(239,108,0,0.35);
  background: rgba(239,108,0,0.08);
  box-shadow: 0 4px 16px rgba(239,108,0,0.15);
}

/* Mnemonic box */
.dict-mnemonic-box {
  font-size: 0.95rem;
  color: var(--text-dark);
  font-style: italic;
  background: var(--bg-gray);
  padding: 10px 15px;
  border-radius: 10px;
  border-left: 4px solid var(--dict-verb);
  line-height: 1.5;
}

/* HSK Simple Badge (like Hanzii) */
.dict-hsk-simple {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 2px 10px;
  letter-spacing: 0.5px;
}


/* ═══════════════════════════════════════════════
   DICT MODAL SYSTEM — Shared modal overlay + card
   ═══════════════════════════════════════════════ */
.dict-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.dict-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.dict-modal-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  animation: dictModalIn 0.3s ease;
}
@keyframes dictModalIn {
  from { transform: scale(0.92) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.dict-modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 1.5rem;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dict-modal-close:hover {
  color: #ff6b6b;
  background: rgba(211,47,47,0.15);
  border-color: rgba(211,47,47,0.4);
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(211,47,47,0.2);
}

/* ═══════════════════════════════════════════════
   PRONUNCIATION SCORER MODAL
   ═══════════════════════════════════════════════ */
.dict-pronunciation-header { text-align: center; margin-bottom: 16px; }
.dict-pronunciation-word {
  font-size: 3rem;
  color: var(--primary-red);
  font-family: 'KaiTi', 'Noto Sans SC', serif;
}
.dict-pronunciation-pinyin {
  font-size: 1.2rem;
  color: var(--dict-particle);
  font-family: monospace;
  margin-top: 4px;
}
.dict-pronunciation-status {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-dark);
  padding: 10px 0;
  min-height: 40px;
}
.dict-pronunciation-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}
.dict-pron-listen-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(211,47,47,0.3);
  background: rgba(211,47,47,0.06);
  color: var(--primary-red);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.dict-pron-listen-btn:hover {
  background: rgba(211,47,47,0.15);
  transform: scale(1.08);
}
.dict-pron-mic-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid #1976D2;
  background: linear-gradient(135deg, #1565C0, #1976D2);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(25,118,210,0.35);
}
.dict-pron-mic-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(25,118,210,0.5);
}
.dict-pron-mic-btn.listening {
  animation: micPulse 1.2s ease infinite;
  background: linear-gradient(135deg, var(--primary-dark, #d32f2f), var(--primary-red, #e53935));
  border-color: var(--primary-red, #d32f2f);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-red, #d32f2f) 50%, transparent);
}
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-red, #d32f2f) 50%, transparent); }
  70% { box-shadow: 0 0 0 15px color-mix(in srgb, var(--primary-red, #d32f2f) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-red, #d32f2f) 0%, transparent); }
}
.dict-pronunciation-result { text-align: center; margin-top: 12px; }
.dict-pron-score-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 4px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  transition: all 0.3s;
}
.dict-pron-score-ring.excellent { border-color: #4CAF50; color: #4CAF50; }
.dict-pron-score-ring.good { border-color: #FF9800; color: #FF9800; }
.dict-pron-score-ring.needs-work { border-color: var(--primary-red, #d32f2f); color: var(--primary-red, #d32f2f); }
.dict-pron-recognized { font-size: 0.9rem; color: var(--text-dark); margin: 8px 0; }
.dict-pron-feedback { font-size: 0.85rem; color: var(--text-dark); }
.dict-pron-tip {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 8px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════
   QUIZ MODE MODAL
   ═══════════════════════════════════════════════ */
.dict-quiz-card { max-width: 500px; }
.dict-quiz-header { margin-bottom: 16px; }
.dict-quiz-header h3 { margin: 0; color: var(--text-dark); font-size: 1.1rem; }
.dict-quiz-canvas-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.dict-quiz-box {
  width: 120px; height: 120px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}
.dict-quiz-status {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-dark);
  min-height: 24px;
}

/* ═══════════════════════════════════════════════
   VIDEO MODAL — Cinema Dark Theme
   ═══════════════════════════════════════════════ */
.dict-video-card {
  max-width: 720px;
  padding: 0 !important;
  background: #0a0a0f !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 32px 80px rgba(0,0,0,0.8),
    0 0 60px rgba(211,47,47,0.08) !important;
}
/* Header bar: tên từ + logo + nút đóng */
.dict-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(90deg, #0d0d1a 0%, #12121f 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 12px;
}
.dict-video-title {
  font-size: 1rem;
  font-weight: 700;
  color: #e0e0e0;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dict-video-title .cinema-word {
  color: var(--primary-red, #ef5350);
  font-size: 1.25rem;
  letter-spacing: 2px;
}
.dict-video-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(211,47,47,0.15);
  color: #ef9a9a;
  border: 1px solid rgba(211,47,47,0.25);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.dict-video-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.dict-video-close:hover {
  background: rgba(211,47,47,0.2);
  border-color: rgba(211,47,47,0.4);
  color: #ff6b6b;
}
/* Iframe stage */
.dict-video-stage {
  position: relative;
  width: 100%;
  background: #000;
  /* Spotlight vignette */
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
}
.dict-video-iframe-wrap {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  position: relative;
  overflow: hidden;
  background: #000;
}
.dict-video-iframe-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
/* Fallback khi iframe bị blocked */
.dict-video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #0a0a0f;
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}
.dict-video-fallback .fallback-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}
.dict-video-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 24px;
  border: 1px solid rgba(211,47,47,0.4);
  background: rgba(211,47,47,0.1);
  color: #ef9a9a;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.dict-video-fallback-btn:hover {
  background: rgba(211,47,47,0.2);
  border-color: rgba(211,47,47,0.6);
  color: #fff;
}
/* Mobile: full-width, giảm border-radius */
@media (max-width: 600px) {
  .dict-video-card {
    border-radius: 12px !important;
    max-width: 100%;
  }
  .dict-video-header { padding: 11px 14px; }
  .dict-video-title { font-size: 0.9rem; }
  .dict-video-title .cinema-word { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════
   REPORT MODAL
   ═══════════════════════════════════════════════ */
.dict-report-card { max-width: 400px; }
.dict-report-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-gray);
  color: var(--text-dark);
  font-size: 0.9rem;
  margin-bottom: 12px;
  cursor: pointer;
  appearance: auto;
}
.dict-report-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-gray);
  color: var(--text-dark);
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 12px;
  min-height: 80px;
  font-family: inherit;
}
.dict-report-textarea:focus,
.dict-report-select:focus {
  outline: none;
  border-color: var(--primary-red);
}
.dict-report-submit {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--primary-red);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dict-report-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.dict-report-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .dict-word-card { padding: 14px; gap: 10px; }
  .dict-word-card__header { gap: 8px; }
  .dict-word-card__header .dict-main-word { font-size: 3.2rem !important; }
  .dict-word-card__meta span:first-child { font-size: 1.3rem !important; }
  .dict-hero-v2 { padding: 14px; }
  .dict-icon-btn, #dict-save-btn { width: 36px; height: 36px; font-size: 14px; }
  .dict-action-chip { padding: 6px 12px; font-size: 0.8rem; }
  .dict-modal-card { padding: 18px; border-radius: 12px; }
  .dict-pronunciation-word { font-size: 2.5rem; }
  .dict-pron-mic-btn { width: 56px; height: 56px; font-size: 20px; }
  .dict-quiz-box { width: 100px; height: 100px; }
}

/* LOAD MORE BUTTON */
#dict-cmt-load-more {
  display: none;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-light, #888);
  background: none;
  border: 1px dashed var(--border-color, #ddd);
  border-radius: 8px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}
#dict-cmt-load-more:hover {
  background: rgba(211, 47, 47, 0.05);
  color: var(--primary-red, #d32f2f);
  border-color: var(--primary-red, #d32f2f);
}

/* IMAGE SKELETON */
#dict-img-skeleton {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
#dict-img-skeleton .skel-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg-gray, #f0f0f0);
  animation: skelPulse 1.5s ease-in-out infinite;
}
@keyframes skelPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}
body.dark-mode #dict-img-skeleton .skel-cell {
  background: #2a2a30;
}

/* ═══════════════════════════════════════════════════════════
   [v7.14] SKELETON SHIMMER — Word Card Loading Placeholder
   Uses CSS variables: works in both light & dark mode
   ═══════════════════════════════════════════════════════════ */
@keyframes skelShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.dict-skel-bar {
  background: linear-gradient(90deg,
    var(--bg-gray) 25%,
    var(--border-color) 50%,
    var(--bg-gray) 75%
  );
  background-size: 200% 100%;
  animation: skelShimmer 1.8s linear infinite;
  border-radius: 6px;
}
.dict-skel-circle {
  background: linear-gradient(90deg,
    var(--bg-gray) 25%,
    var(--border-color) 50%,
    var(--bg-gray) 75%
  );
  background-size: 200% 100%;
  animation: skelShimmer 1.8s linear infinite;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════
   [v7.14] KEYBOARD NAV — Focused suggest item highlight
   ═══════════════════════════════════════════════════════════ */
.dict-suggest-item--focused {
  background: linear-gradient(to right, rgba(211,47,47,0.08), transparent) !important;
  border-left: 4px solid var(--primary-red) !important;
}
body.dark-mode .dict-suggest-item--focused {
  background: linear-gradient(to right, rgba(211,47,47,0.15), transparent) !important;
}

/* ═══════════════════════════════════════════════════════════
   [v7.14] COMPOUND HOVER TOOLTIP — Glassmorphism preview
   ═══════════════════════════════════════════════════════════ */
.dict-compound-tooltip {
  position: fixed;
  z-index: 10001;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 280px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-dark);
}
.dict-compound-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}
.dict-compound-tooltip .tt-hz {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-red);
}
.dict-compound-tooltip .tt-py {
  color: var(--dict-particle);
  font-family: monospace;
  font-weight: 600;
}
.dict-compound-tooltip .tt-vi {
  color: var(--text-light);
  margin-top: 2px;
}
.dict-compound-tooltip .tt-cta {
  color: var(--text-light);
  font-size: 0.78rem;
  margin-top: 4px;
  opacity: 0.7;
}
/* DARK MODE — rel-tag overrides */
body.dark-mode .rel-tag.syn {
  background: rgba(46, 125, 50, 0.15);
  border-color: rgba(76, 175, 80, 0.3);
}
body.dark-mode .rel-tag.syn:hover {
  background: rgba(46, 125, 50, 0.3);
}
body.dark-mode .rel-tag.anti {
  background: rgba(198, 40, 40, 0.15);
  border-color: rgba(239, 83, 80, 0.3);
}
body.dark-mode .rel-tag.anti:hover {
  background: rgba(198, 40, 40, 0.3);
}

/* DARK MODE — comp-details / summary / content */
body.dark-mode .comp-details {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .comp-summary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--primary-red, #e53935);
}
body.dark-mode .comp-content {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
}
/* Plain .rel-tag (no .syn/.anti) — Từ Ghép items */
body.dark-mode .rel-tag {
  color: rgba(255, 255, 255, 0.85);
}
body.dark-mode .rel-tag b {
  color: var(--primary-red, #e53935);
}
body.dark-mode #dict-save-btn {
  background: rgba(255, 82, 82, 0.08);
  border-color: rgba(255, 82, 82, 0.25);
  color: #ff5252;
}
body.dark-mode #dict-save-btn:hover {
  background: rgba(255, 82, 82, 0.15);
  border-color: rgba(255, 82, 82, 0.6);
  box-shadow: 0 4px 14px rgba(255, 82, 82, 0.2);
}
body.dark-mode #dict-cmt-load-more {
  border-color: #444;
  color: #888;
}
body.dark-mode #dict-cmt-load-more:hover {
  background: rgba(255, 82, 82, 0.08);
  color: #ff5252;
  border-color: #ff5252;
}

/* ===================================================
   PHASE 4 — DICTIONARY IMAGE GRID & VOTING
   CSS vars: --bg-gray, --border-color, --text-light, --primary-red
   =================================================== */

/* Module wrapper */
.dict-img-module {
  padding: 14px 16px;
  margin-top: 15px;
  background: var(--bg-dark, #fff);
  border-radius: 15px;
  border: 1px solid var(--border-color, #dfe6e9);
}

/* Grid layout */
.dict-img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Individual image cell */
.img-cell {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1;
  background: var(--bg-gray, #f1f2f6);
}
.img-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Pending review blur */
.img-blur img {
  filter: blur(8px);
  transition: filter 0.3s ease;
}

/* Overlay for pending images */
.img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2;
  pointer-events: none;
}
.img-overlay span {
  font-size: 10px;
  color: #fff;
  text-align: center;
  line-height: 1.4;
}

/* Vote bar at bottom of each cell */
.img-vote-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: space-between;
  padding: 3px 6px;
  z-index: 3;
}
.img-vote-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  transition: color 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.img-vote-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

/* Active vote highlight — cam #f97316 */
.vote-btn--active {
  color: #f97316 !important;
  font-weight: bold;
}

/* Upload cell (dashed border) */
.img-upload-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border-color, #dfe6e9);
  background: var(--bg-gray, #f1f2f6);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  border-radius: 8px;
  aspect-ratio: 1;
}
.img-upload-cell:hover {
  background: rgba(211, 47, 47, 0.06);
  border-color: var(--primary-red, #d32f2f);
}
.img-upload-cell span {
  font-size: 11px;
  text-align: center;
  color: var(--text-light, #636e72);
  line-height: 1.4;
}

/* Count badge */
.dict-img-count {
  font-size: 11px;
  background: var(--bg-gray, #f1f2f6);
  padding: 2px 10px;
  border-radius: 20px;
  color: var(--text-light, #636e72);
}

/* DARK MODE */
body.dark-mode .dict-img-module {
  background: #1e1e24;
  border-color: #333;
}
body.dark-mode .img-cell {
  background: #2a2a30;
}
body.dark-mode .img-upload-cell {
  background: #2a2a30;
  border-color: #444;
}
body.dark-mode .img-upload-cell:hover {
  background: rgba(255, 82, 82, 0.08);
  border-color: #ff5252;
}
body.dark-mode .img-upload-cell span {
  color: #888;
}
body.dark-mode .dict-img-count {
  background: #2a2a30;
  color: #888;
}

/* ═══════════════════════════════════════════════════════════
   DICTIONARY MOBILE OPTIMIZATIONS — v7.01
   Target: 320px–520px (phone portrait)
   Principles: compact spacing, readable fonts, 44px tap targets
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 520px) {

  /* 1. HANZI FONT — 4.5rem quá to trên phone 400px */
  .dict-main-word,
  [style*="font-size: 4.5rem"],
  [style*="font-size:4.5rem"] {
    font-size: 3rem !important;
  }
  /* Pinyin vẫn đọc được */
  [style*="font-size: 1.8rem"],
  [style*="font-size:1.8rem"] {
    font-size: 1.3rem !important;
  }

  /* 2. DICT HEADER — compact padding */
  [style*="border-bottom: 3px solid var(--border-color)"] {
    padding-bottom: 14px !important;
    gap: 10px !important;
  }

  /* 3. SPEAKER + SAVE ROW — compact gap */
  [style*="margin-top: 20px"][style*="inline-flex"] {
    margin-top: 12px !important;
    gap: 10px !important;
  }
  .speak-btn[style] {
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
  }

  /* 4. SECTION TITLE — giảm margin top */
  .dict-section-title {
    margin: 16px 0 10px !important;
    font-size: 1rem;
  }

  /* 5. COMMENT BOX — layout dọc trên mobile nhỏ */
  .dict-comment-box {
    padding: 12px !important;
  }
  /* Input + gửi: bỏ gap lớn, wrap tốt hơn */
  .dict-comment-box > div[style*="flex"][style*="gap"] {
    flex-wrap: wrap !important;
  }
  #dict-cmt-input {
    font-size: 14px !important;
    padding: 9px 12px !important;
  }
  /* Nút Gửi luôn đủ 44px touch target */
  .dict-comment-box .btn-red {
    min-height: 44px !important;
    padding: 10px 16px !important;
  }

  /* 6. VOTE BUTTONS — 44px touch target theo Apple HIG */
  .img-vote-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    justify-content: center;
  }
  .img-vote-bar {
    padding: 0 !important;
  }

  /* 7. IMAGE MODULE — compact header padding */
  #dict-img-module > div:first-child {
    padding: 10px 12px 8px !important;
  }
  #dict-img-grid,
  #dict-img-skeleton + div {
    padding: 0 12px 12px !important;
  }
  #dict-img-hint {
    padding: 0 12px 10px !important;
  }

  /* 8. REL TAGS — horizontal scroll thay wrap (tránh chiếm nhiều dòng) */
  .rel-tag-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 6px;
    scrollbar-width: none;
  }
  .rel-tag-container::-webkit-scrollbar { display: none; }
  .rel-tag {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.85rem;
    padding: 5px 10px;
  }

  /* 9. EXAMPLE CARD — compact */
  .dict-ex-card {
    padding: 9px 12px !important;
    font-size: 0.92rem;
  }

  /* 10. COMP-DETAILS (Từ ghép, v.v) — giảm padding */
  .comp-summary {
    padding: 9px 12px !important;
    font-size: 0.9rem !important;
  }
  .comp-content {
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
  }

  /* 11. LOOKUP STATS — compact */
  [style*="fa-fire"] {
    font-size: 0.85rem !important;
  }
}

/* Very small phones — 360px */
@media (max-width: 380px) {
  .dict-main-word,
  [style*="font-size: 4.5rem"],
  [style*="font-size:4.5rem"] {
    font-size: 2.6rem !important;
  }
  [style*="font-size: 1.8rem"],
  [style*="font-size:1.8rem"] {
    font-size: 1.1rem !important;
  }
  .dict-img-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
  }
}
