/*
 * 数据型句库博客文章的共享样式。
 *
 * 文章框架、页面背景和正文颜色继续复用博客 shared.css；这里只保留句库所需的信息层级
 * 与 App 引导交互。句子区域刻意使用透明背景，避免把客户端的固定暗色收藏列表照搬到网页。
 * 类名前缀沿用最早的 travel 页面以避免无意义改写既有静态 HTML，N1 等数据型文章也复用本文件。
 */

.travel-language-links {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 0.9rem;
}

.travel-language-links a {
  padding: 5px 10px;
  border: 1px solid #d7dce2;
  border-radius: 999px;
  color: #536170;
}

.travel-language-links a[aria-current="page"] {
  border-color: #0175c2;
  background: rgba(1, 117, 194, 0.10);
  color: #0175c2;
  font-weight: 700;
}

.travel-intro {
  margin-bottom: 28px;
}

.travel-intro strong {
  color: #0175c2;
}

.travel-collection-shell {
  margin: 30px 0 38px;
  background: transparent;
  color: inherit;
}

.travel-collection-header {
  padding: 0;
}

.travel-collection-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.travel-collection-title-row h2 {
  flex: 1;
  margin: 0;
  font-size: 1.45rem;
}

.travel-item-total {
  color: #666;
  font-size: 0.86rem;
  white-space: nowrap;
}

.travel-sections {
  padding: 0;
}

.travel-section {
  scroll-margin-top: 24px;
}

.travel-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 34px 0 5px;
  padding: 0 0 10px;
  border-bottom: 1px solid #eee;
  background: transparent;
}

.travel-section-heading h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.45;
}

.travel-section-count {
  flex: 0 0 auto;
  color: #666;
  font-size: 0.8rem;
}

.travel-section-goal {
  margin: 8px 0 4px;
  color: #666;
  font-size: 0.86rem;
  line-height: 1.55;
}

.travel-sentence-list {
  display: grid;
  gap: 0;
}

.travel-sentence-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 22px;
  gap: 11px;
  width: 100%;
  padding: 25px 6px 23px;
  border: 0;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.travel-sentence-card:hover,
.travel-sentence-card:focus-visible {
  border-radius: 12px;
  outline: none;
  background: rgba(1, 117, 194, 0.06);
}

/*
 * 分隔线属于上一条句子的下边框。下一条出现圆角悬停背景时，如果继续绘制这条边框，
 * 它会从圆角两侧露出一小截。这里只隐藏紧邻悬停/键盘聚焦项之前的那一条边框，
 * 不改变普通浏览状态下的条目分隔，也不会让列表整体失去层次。
 */
.travel-sentence-card:has(+ .travel-sentence-card:is(:hover, :focus-visible)) {
  border-bottom-color: transparent;
}

.travel-sentence-card:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(1, 117, 194, 0.58);
}

.travel-sentence-number {
  align-self: start;
  padding-top: 5px;
  color: #0175c2;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.travel-sentence-number::after {
  display: block;
  margin-top: 2px;
  color: #0175c2;
  content: "▶";
  font-size: 0.92rem;
}

.travel-sentence-main {
  min-width: 0;
}

.travel-japanese {
  display: block;
  color: inherit;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: clamp(1.18rem, 2.5vw, 1.48rem);
  font-weight: 650;
  line-height: 1.95;
  letter-spacing: 0.015em;
}

.travel-japanese ruby {
  ruby-position: over;
}

.travel-japanese rt {
  color: #666;
  font-size: 0.48em;
  font-weight: 500;
}

.travel-translation {
  display: block;
  margin-top: -2px;
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
}

.travel-tag {
  display: block;
  margin-top: 9px;
  padding: 2px 0 2px 10px;
  border-left: 2px solid #d7dce2;
  background: transparent;
  color: #666;
  font-size: 0.82rem;
  line-height: 1.52;
}

.travel-card-action {
  align-self: center;
  color: #8a939d;
  font-size: 1rem;
  transition: color 150ms ease, transform 150ms ease;
}

.travel-sentence-card:hover .travel-card-action,
.travel-sentence-card:focus-visible .travel-card-action {
  color: #0175c2;
  transform: translateX(2px);
}

.travel-dialog {
  width: min(88vw, 470px);
  padding: 0;
  border: 1px solid #dce1e7;
  border-radius: 20px;
  background: #fff;
  color: #25313e;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.travel-dialog::backdrop {
  background: rgba(4, 8, 12, 0.72);
  backdrop-filter: blur(4px);
}

.travel-dialog-content {
  padding: 24px 24px 20px;
}

.travel-dialog h2 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #25313e;
  font-size: 1.28rem;
}

.travel-dialog p {
  margin: 0;
  color: #526170;
  line-height: 1.65;
}

.travel-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.travel-dialog-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.travel-dialog-button--secondary {
  background: #edf0f3;
  color: #44515e;
}

.travel-dialog-button--primary {
  background: #0175c2;
  color: #fff;
}

.travel-dialog-button--primary:hover {
  background: #0065a8;
}

@media (max-width: 640px) {
  .travel-sentence-card {
    grid-template-columns: 32px minmax(0, 1fr) 17px;
    gap: 8px;
    padding: 21px 2px 20px;
  }

  .travel-section-heading {
    padding-bottom: 9px;
  }

  .travel-section-goal {
    margin-right: 0;
    margin-left: 0;
  }

  .travel-dialog-actions {
    flex-direction: column-reverse;
  }

  .travel-dialog-button {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (prefers-color-scheme: dark) {
  .travel-language-links a {
    border-color: #39424d;
    color: #b7c3cf;
  }

  .travel-language-links a[aria-current="page"] {
    border-color: #75bfff;
    background: rgba(117, 191, 255, 0.13);
    color: #8ac8ff;
  }

  .travel-intro strong {
    color: #8ac8ff;
  }

  .travel-item-total,
  .travel-section-count,
  .travel-section-goal,
  .travel-japanese rt,
  .travel-translation,
  .travel-tag {
    color: #aaa;
  }

  .travel-section-heading,
  .travel-sentence-card {
    border-color: #333;
  }

  .travel-tag {
    border-left-color: #46515d;
  }

  .travel-sentence-number,
  .travel-sentence-number::after,
  .travel-sentence-card:hover .travel-card-action,
  .travel-sentence-card:focus-visible .travel-card-action {
    color: #64b5f6;
  }

  .travel-sentence-card:hover,
  .travel-sentence-card:focus-visible {
    background: rgba(100, 181, 246, 0.08);
  }

  .travel-dialog {
    border-color: #3b4148;
    background: #25292e;
    color: #f4f6f8;
  }

  .travel-dialog h2 {
    color: #f4f6f8;
  }

  .travel-dialog p {
    color: #c6ccd2;
  }

  .travel-dialog-button--secondary {
    background: #3a4047;
    color: #eef1f4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .travel-card-action {
    transition: none;
  }
}
