/* 생활 영어 한 줄 — Craigslist 스타일 텍스트 목록 */
@import url("redesign-tokens.css");

.de-page {
  --de-blue: #3d6eb8;
  --de-ink: #3a3834;
  --de-ink-soft: #6a6660;
  --de-ink-muted: #7a756c;
  --de-muted: #7a756c;
  --de-line: rgba(58, 56, 52, 0.12);
  --de-max: 680px;
  --de-body: 17px;
  --de-num-w: 4.5ch;
  --de-gap: 0.75rem;
  margin: 0;
  font-family: var(--font-sans, "IBM Plex Sans KR", sans-serif);
  color: var(--de-ink);
  background: var(--page-bg, #F6F3EC);
  -webkit-font-smoothing: antialiased;
}

.de-main {
  max-width: var(--de-max);
  margin: 0 auto;
  padding: 48px 24px 120px;
  box-sizing: border-box;
}

.de-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.de-title {
  margin: 0;
  font-size: clamp(20px, 3.2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--ink, #1c1917);
}

.de-lead {
  margin: 0;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.55;
  color: var(--de-ink-muted);
}

.de-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.de-search {
  flex: 1 1 260px;
  min-width: 0;
}

.de-search input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line, rgba(58, 56, 52, 0.18));
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--de-ink);
  font-family: inherit;
  font-size: 15px;
}

.de-search input:focus {
  outline: none;
  border-color: var(--de-blue);
  box-shadow: 0 0 0 3px rgba(61, 110, 184, 0.15);
}

.de-count {
  margin: 0;
  font-size: 13px;
  color: var(--de-ink-muted);
  white-space: nowrap;
}

/* 문장 섹션과 동일 — 전체 뜻 가리기/해제하기 */
.de-hide-meaning-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 0 0.55em 0 0.35em;
  height: 1.85em;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #2f5f9e;
  background: #fff;
  border: 1.5px solid rgba(47, 95, 158, 0.55);
  border-radius: 999px;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  box-shadow:
    0 0 0 2px rgba(47, 95, 158, 0.12),
    0 0 10px rgba(47, 95, 158, 0.28);
  animation: de-hide-halo 7.5s ease-in-out infinite;
}

.de-hide-meaning-toggle:hover {
  color: var(--de-blue);
  border-color: var(--de-blue);
  animation: none;
  box-shadow:
    0 0 0 3px rgba(47, 95, 158, 0.18),
    0 0 14px rgba(47, 95, 158, 0.35);
}

.de-hide-meaning-input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--de-blue);
  cursor: pointer;
  flex-shrink: 0;
}

@keyframes de-hide-halo {
  0%,
  72%,
  100% {
    box-shadow:
      0 0 0 2px rgba(47, 95, 158, 0.1),
      0 0 8px rgba(47, 95, 158, 0.2);
    border-color: rgba(47, 95, 158, 0.45);
  }
  78% {
    box-shadow:
      0 0 0 5px rgba(47, 95, 158, 0.2),
      0 0 18px rgba(47, 95, 158, 0.45);
    border-color: rgba(47, 95, 158, 0.85);
  }
  84% {
    box-shadow:
      0 0 0 2px rgba(47, 95, 158, 0.12),
      0 0 10px rgba(47, 95, 158, 0.28);
    border-color: rgba(47, 95, 158, 0.55);
  }
  90% {
    box-shadow:
      0 0 0 4px rgba(47, 95, 158, 0.16),
      0 0 14px rgba(47, 95, 158, 0.38);
    border-color: rgba(47, 95, 158, 0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  .de-hide-meaning-toggle {
    animation: none;
  }
}

.de-download-btn {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fafafa;
  font-size: 13px;
  cursor: pointer;
}

.de-download-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.de-rule {
  height: 1px;
  background: var(--de-line);
  margin: 22px 0 8px;
}

/* Grid: 번호 | 본문 — 한국어·영어·예문·번역 시작 X 일치 */
.de-item {
  display: grid;
  grid-template-columns: var(--de-num-w) minmax(0, 1fr);
  column-gap: var(--de-gap);
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--de-line);
}

.de-num {
  grid-column: 1;
  grid-row: 1 / span 20;
  font-variant-numeric: tabular-nums;
  font-size: var(--de-body);
  line-height: 1.55;
  color: var(--de-ink-muted);
  text-align: right;
  user-select: none;
}

.de-body {
  grid-column: 2;
  min-width: 0;
}

/* 영어 표현 — one-sentence .os-head-en */
.de-en {
  margin: 0 0 2px;
  font-family: inherit;
  font-size: var(--de-body);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--de-blue);
}

/* 한국어 표현 — one-sentence .os-ko 톤 (기본 blur) */
.de-ko {
  margin: 4px 0 0;
  font-size: var(--de-body);
  line-height: 1.7;
  font-weight: 400;
  color: var(--de-ink-soft);
  transition: filter 0.18s ease;
}

.de-example-block {
  margin-top: 10px;
}

/* 영어 예문 — one-sentence .os-en */
.de-example {
  margin: 0;
  font-family: inherit;
  font-size: var(--de-body);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
  color: var(--de-ink);
}

/* 예문 한글 — one-sentence .os-ko (기본 blur) */
.de-translation {
  margin: 4px 0 0;
  font-size: var(--de-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--de-ink-soft);
  transition: filter 0.18s ease;
}

/* 문장 섹션과 동일 — 한글 뜻 기본 blur, 뜻 보기로 해제 */
body.de-hide-meaning .de-ko,
body.de-hide-meaning .de-translation,
body:not(.de-hide-meaning) .de-item.is-meaning-hidden .de-ko,
body:not(.de-hide-meaning) .de-item.is-meaning-hidden .de-translation {
  filter: blur(3.5px);
  user-select: none;
}

body.de-hide-meaning .de-item.is-meaning-shown .de-ko,
body.de-hide-meaning .de-item.is-meaning-shown .de-translation {
  filter: none;
  user-select: text;
}

/* 뜻 보기 · 저장 · 댓글 · 글쓰기 — one-sentence 와 동일 한 줄 */
.de-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 14px;
  row-gap: 8px;
  margin-top: 10px;
}

.de-actions > .de-comments-root,
.de-actions > .board-comments-root {
  display: contents;
}

.de-actions .os-cmt-bar {
  display: contents;
  margin: 0;
  width: auto;
  justify-content: flex-start;
}

.de-actions .os-cmt-panel {
  flex: 1 1 100%;
  width: 100%;
  margin-top: 4px;
}

.de-actions .os-cmt-toggle,
.de-actions .os-cmt-write,
.de-actions .de-meaning-toggle,
.de-actions .de-save-toggle,
.de-actions .de-item-download {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  color: var(--de-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
  -webkit-text-fill-color: currentColor;
  flex: 0 0 auto;
  height: auto;
}

.de-actions .de-meaning-toggle:hover,
.de-actions .de-meaning-toggle[aria-pressed="true"],
.de-actions .de-save-toggle:hover,
.de-actions .de-save-toggle[aria-pressed="true"],
.de-actions .de-item-download:hover,
.de-actions .os-cmt-toggle:hover,
.de-actions .os-cmt-write:hover {
  opacity: 1;
  color: var(--de-blue);
  -webkit-text-fill-color: currentColor;
  background: none;
}

.de-item-download[hidden] {
  display: none !important;
}

.de-status {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--de-muted);
  text-align: center;
  min-height: 1.2em;
}

.de-retry-wrap {
  text-align: center;
  margin: 8px 0 0;
}

.de-retry-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.de-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
}

.de-report {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.de-report-btn,
.de-report-mail {
  font-size: 13px;
  color: var(--de-blue);
}

.de-back-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 40;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.de-empty {
  margin: 32px 0;
  font-size: 14px;
  color: var(--de-muted);
  text-align: center;
}

@media (max-width: 480px) {
  .de-main {
    padding: 32px 16px 100px;
  }
  .de-page {
    --de-num-w: 3.5ch;
    --de-gap: 0.55rem;
  }
}
