/* Thiết kế theo từng khung của nội dung chính */
/* ==== Layout chia 7-3 với responsive ==== */
.word-container {
  display: flex;
  flex-wrap: wrap;
  column-gap: 2rem; /* tách riêng column để tăng khoảng cách chiều ngang */
  gap: 1.5rem;
}

.word-main-content {
  flex: 0 0 calc(65% - 0.75rem);
  max-width: calc(65% - 0.75rem);
}

.word-sidebar {
  flex: 0 0 calc(35% - 0.75rem);
  max-width: calc(35% - 0.75rem);
  font-size: 0.95rem;
  color: #333;
}
.word-sidebar-content{
  background: #fdfdfd;
  border: 1px solid #dce6f1;
  /*border-left: 6px solid #3399ff;*/
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: #222;
}
.word-sidebar-content > h3:first-child {
  margin-top: 0; /*Để thẳng hàng với bên trái*/
}

/* 👇 Responsive cho điện thoại */
@media (max-width: 768px) {
  .word-main-content, .word-sidebar {
    flex: 0 0 100%;
    max-width: 100%;
  }
}


/* Thiết kế hiển thị kết quả tìm kiếm */
.word-main {
  background: #fdfdfd;
  border: 1px solid #dce6f1;
  /*border-left: 6px solid #3399ff;*/
  border-left:4px solid #3498db;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: #222;
}

/* Từ chính */
.word-main .word {
  font-size: 1.4rem;
  font-weight: 700;
  color: #003366;
  margin-bottom: 0.3rem;
}

.chuthich {
    font-size: 0.5em;
    color: #777;
    margin-left: 0.3em;
    font-style: italic;
}
.re_pri{
    color: #cc9900;
    padding: 0.1rem 0rem 0.3rem 0rem;
}

/* Âm Hán Việt */
.word-main .hanviet {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.6rem;
  font-style: italic;
}

/* Loại từ và cấp độ JLPT */
.word-main .wordinf span{
  font-size: 0.95rem;
  display: inline-block;
  border-radius: 6px;
}
.word-main .wordinf .loaitu{
  background: #e6f3ff;
  color: #007acc;
  padding: 0.1rem 0.6rem 0.3rem 0.6rem;
  margin-right: 0.3rem;
}
.word-main .wordinf .jlpt_level{
  background: #fff9e6;
  color: #cc9900
}


/* Phần accent */
.word-main .accent {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.pitch-accent {
  display: inline-block;
  position: relative;
  font-family: 'Noto Sans JP', sans-serif;
}

.low-before {
  color: #444;
  border-top: 2px solid transparent;
}

.low {
  color: #444;
  border-top: 2px solid transparent;
}

.high {
  color: #000;
  border-top: 2px solid #c00;
}

.drop {
  color: #000;
  border-top: 2px solid #c00;
  position: relative;
}

.drop::after {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  height: 50%;
  border-right: 2px solid #c00;
  box-sizing: border-box;
}

/* Giải thích */
.word-main .explanation {

  /*padding: 1rem 1.2rem;*/
  /*margin-top: 1rem;*/
  /*border-radius: 8px;*/
  /*box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);*/
  /*font-size: 1rem;*/
  /*line-height: 1.7;*/
  /*color: #333;*/
}

.meaning-block {
  /*border-left: 4px solid #3498db;*/
  /*padding: 10px 20px;*/
  /*margin-bottom: 1.5em;*/
  /*background: #f9f9f9;*/
  /*border-radius: 8px;*/
}

.word-container h3 {
  margin-top: 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #003366;
  border-bottom: 2px solid #d0d7e1;
  margin-bottom: 0.75rem;
}


.sense {
  background: #fdfdfd;
  border-radius: 10px;
  border-top: 1px dashed #ccc;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
  padding: 0.2em 0.6em;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

/* Sense đầu tiên */
.sense-first {

}

/* Sense cuối cùng */
.sense-last {
  border-bottom: 1px dashed #ccc;
}


.meaning p{
  color:#a0522d;               /* Xanh tươi nổi bật */
  font-size: 1.05rem;
  font-weight: 600;             /* Chữ đậm hơn, rõ ràng hơn */
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.2;
  position: relative;
  padding-left: 1.5rem;
}
.meaning p::before {
  content: "➤"; /* hoặc "→" */
  position: absolute;
  left: 0;
  color: #a52a2a; /* tông nâu nổi bật hơn */
}


.example-list {
  list-style: disc;
  margin-left: 1.5em;
  padding-left: 0.5em;
}

.example-list li {
  margin-bottom: 0.8em;
}

.jp {
  font-weight: bold;
}

.vi {
  display: block;
  color: #555;
  margin-top: 4px;
}


/*--------------------------
Phần KANJI có trong truy vấn
----------------------------*/

.kanji-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.kanji-row {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #dce6f1;
  border-radius: 8px;
  padding: 0.1rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.kanji-row {
  cursor: pointer; /* con trỏ dạng link/nút */
  transition: background-color 0.2s ease;
}

.kanji-row:hover {
  background-color: #f0f8ff; /* màu nền khi hover */
}

.kanji-char {
  font-size: 2.8rem;
  font-weight: bold;
  color: #003366;
  font-family: 'Noto Serif JP', serif;
  width: 2.5rem;
  text-align: center;
  margin-right: 1rem;
  margin-top: 0.5rem;
}

.kanji-info {
  display: flex;
  flex-direction: column;
}

.kanji-hanviet {
  font-size: 1rem;
  font-weight: 600;
  color: #b22222;
}

.kanji-nghia {
  font-size: 0.9rem;
  color: #555;
}



/* -------------------------      
Thiết kế cho phần sidebar
---------------------------*/

.lienquan-container{
  display:flex; flex-wrap:wrap; gap:10px; margin-top:8px;
}

.lienquan-item{
  width:100%;
  border:1px solid #ddd; border-radius:10px;
  padding:6px 10px;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  cursor:pointer;

  /* trạng thái trước animate */
/*  opacity:0;
  transform: translateY(6px);
  will-change: opacity, transform;*/
}

/* Ẩn khi vượt ngưỡng ban đầu */
.lienquan-item.is-hidden{ display:none; }

/* Hover */
.lienquan-item:hover{
  background:#e7f0fb;
  border-color:#80bfff;
  box-shadow:0 3px 6px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

/* Typography */
.lienquan-word{ 
  font-family: 'Noto Serif JP', serif;
  font-weight: 900;              /* đậm hơn: 800–900 */
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: .1px;
  color: black;                /* đậm hơn #003366 */
  text-shadow: 0 1px 0 rgba(0,0,0,.05); /* viền nhẹ tăng độ nét */
  text-decoration: none; /* không có gạch chân ở link */
}
.lienquan-gloss{
  font-size: 14px;               /* nhỉnh hơn 12px để dễ đọc */
  color: black;
  margin-bottom: 4px;
}
/* Nếu sau này bạn nối gloss bằng \n */
.lienquan-gloss { white-space: pre-line; }
.lienquan-gloss.no-gloss{ color:#aaa; font-style:italic; }

/* Nút load more */
.load-more-wrap{ text-align:center; margin-top:8px; }
.load-more-btn{
  padding:6px 12px; border:1px solid #dce6f1;
  background:linear-gradient(135deg,#f7faff,#eef5ff);
  border-radius:999px; cursor:pointer; font-size:14px; color:#1f3b63;
  transition: all .15s ease; box-shadow:0 2px 6px rgba(0,0,0,.05);
}
.load-more-btn:hover{ background:#e7f0ff; border-color:#bad4ff; transform:translateY(-1px); }

/* ===== Appear animation ===== */
/*.lienquan-item.show{
  /* JS sẽ set --rl-dur và --rl-delay cho từng item */
/*  animation: rl-fade-in var(--rl-dur, 100ms) ease both;
  animation-delay: var(--rl-delay, 0ms);*/
/*}*/
/*@keyframes rl-fade-in{
  from{ opacity:0; transform: translateY(6px); }
  to  { opacity:1; transform: translateY(0); }
}*/

/* Tôn trọng người dùng hạn chế motion */
/*@media (prefers-reduced-motion: reduce){
  .lienquan-item{ opacity:1; transform:none; transition:none; }
  .lienquan-item.show{ animation:none; }
}*/
