/* =========================================================
   拾读 · 短句阅读页
   复用 styles.css 的调色板与页头，这里只放这一页特有的布局
   ========================================================= */

.sentence-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) 20px 72px;
}

/* ---------- 顶栏：筛选 ---------- */

.sentence-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.sentence-filters {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.sentence-filter {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

.sentence-filter span {
  margin-left: 2px;
  font-size: 11px;
  color: var(--ink-faint);
}

.sentence-filter:hover { color: var(--ink); }

.sentence-filter.is-active {
  background: var(--green);
  color: var(--green-contrast);
}

.sentence-filter.is-active span { color: inherit; opacity: .72; }

.sentence-hint {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---------- 组列表 ---------- */

.sentence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sentence-group {
  margin: 0;
}

.sentence-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px 2px;
  font-family: var(--font-ui);
}

.sentence-group-no {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-faint);
}

.sentence-group-count {
  font-size: 11px;
  color: color-mix(in srgb, var(--ink-faint) 80%, transparent);
}

.sentence-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  counter-reset: sentence;
}

.sentence-card {
  position: relative;
  padding: 20px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  transition: border-color .15s ease, background-color .15s ease;
}

.sentence-card:hover { border-color: var(--line-strong); }

.sentence-card.is-wide {
  grid-column: 1 / -1;
}

.sentence-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: var(--ink-faint);
}

.sentence-tag {
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .04em;
  white-space: nowrap;
  flex: 0 0 auto;
}

.sentence-tag--article { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green-deep); }
.sentence-tag--quote { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.sentence-tag--literary {
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  color: var(--paper);
}
.sentence-tag--hard {
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  color: color-mix(in srgb, var(--ink) 74%, transparent);
}

.sentence-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentence-speak {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.sentence-speak:hover { color: var(--ink); border-color: var(--line-strong); }

.sentence-en {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.75;
  color: var(--ink);
}

.sentence-word {
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--green) 34%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.sentence-word:hover,
.sentence-word:focus-visible {
  color: var(--green);
  text-decoration-color: var(--green);
  outline: none;
}

.sentence-zh {
  margin: 12px 0 0;
  display: none;
  font-family: var(--font-zh-serif);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--green) 30%, transparent);
}

.sentence-note {
  margin: 10px 0 0;
  display: none;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

.sentence-card.is-open .sentence-zh,
.sentence-card.is-open .sentence-note { display: block; }

.sentence-reveal {
  margin-top: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--green-deep);
  cursor: pointer;
}

.sentence-reveal:hover { text-decoration: underline; }

.sentence-empty {
  padding: 40px 0;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- 点词弹层 ---------- */

.sentence-popover {
  position: fixed;
  z-index: 80;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-lift);
}

.sentence-popover-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sentence-popover-word {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
}

.sentence-popover-phonetic {
  margin: 2px 0 0;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--accent);
}

.sentence-popover-def {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.sentence-popover-zh {
  margin: 8px 0 0;
  font-family: var(--font-zh-serif);
  font-size: 14px;
  color: var(--ink);
}

.sentence-popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.sentence-mini-btn {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}

.sentence-mini-btn:hover { border-color: var(--line-strong); color: var(--ink); }

/* ---------- 页脚 ---------- */

.sentence-site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: var(--ink-faint);
}

@media (max-width: 980px) {
  .sentence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sentence-card.is-wide { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .sentence-grid { grid-template-columns: 1fr; gap: 12px; }
  .sentence-card { padding: 16px 16px 14px; }
  .sentence-en { font-size: 17px; }
  .sentence-hint { display: none; }
  .sentence-filter { padding: 6px 11px; font-size: 12.5px; }
  .sentence-bar { flex-wrap: nowrap; }
  .sentence-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
  }
  .sentence-filters::-webkit-scrollbar { display: none; }
  .sentence-filter { flex: 0 0 auto; }
  .sentence-main { padding: 16px 14px 56px; }
}

/* ---------- 翻页 ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 30px 0 10px;
  font-family: var(--font-ui);
}

.pager[hidden] {
  display: none;
}

.pager-btn {
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}

.pager-btn:hover:not(:disabled) {
  color: var(--green);
  border-color: var(--green);
}

.pager-btn:disabled {
  opacity: .38;
  cursor: default;
}

.pager-label {
  font-size: 13px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.pager-jump {
  width: 58px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  text-align: center;
}

.pager-jump:focus {
  outline: none;
  border-color: var(--line-strong);
}

@media (max-width: 640px) {
  .pager { gap: 10px; }
  .pager-btn { padding: 8px 12px; }
}
