/* 문장으로 익히는 단어 — 노트에 일기 쓰듯 이어 읽기 */
@import url("redesign-tokens.css");

.os-page {
  --os-blue: #3d6eb8;
  --os-ink: #3a3834;
  --os-ink-soft: #6a6660;
  --os-ink-muted: #7a756c;
  --os-hl: #f3ecc0;
  --os-max: 680px;
  --os-body: 17px;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--os-ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

.os-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--os-blue);
}

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

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

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

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

.os-search input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.os-search input::placeholder {
  color: #9a968c;
}

.os-search input:focus {
  border-color: var(--os-blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.os-count {
  margin: 0;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}

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

.os-alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 18px 0 0;
  padding: 0;
}

.os-alpha[hidden] {
  display: none !important;
}

.os-alpha-link {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  min-width: 1.2em;
  text-align: center;
}

.os-alpha-link:hover {
  color: var(--os-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 알파벳별 분류 피드 */
.os-feed {
  display: block;
  padding-top: 8px;
}

.os-letter-group {
  margin: 0;
  padding: 0;
}

.os-letter-head {
  margin: 32px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  font-size: var(--os-body);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--os-ink-soft);
  scroll-margin-top: 88px;
}

.os-letter-group:first-child .os-letter-head {
  margin-top: 12px;
}

.os-item {
  display: block;
  padding: 26px 0 24px;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  scroll-margin-top: 88px;
}

.os-letter-group .os-item:last-child {
  border-bottom: none;
}

.os-num {
  display: none !important;
}

/* 1줄: 단어 + 발음 / 2줄: 품사 + 뜻 */
.os-head {
  margin: 0 0 2px;
  font-size: var(--os-body);
  line-height: 1.55;
  color: var(--os-ink);
}

.os-head-en {
  font-size: inherit;
  font-weight: 700;
  color: var(--os-blue);
  letter-spacing: -0.01em;
}

.os-head-sound {
  font-size: inherit;
  font-weight: 400;
  color: var(--os-ink-soft);
  white-space: nowrap;
}

.os-head-ipa {
  font-family: "Lucida Sans Unicode", "Arial Unicode MS", "Segoe UI", sans-serif;
  font-size: inherit;
  color: var(--os-ink-soft);
}

.os-head-pron {
  font-size: inherit;
  font-weight: 500;
  color: var(--os-ink-soft);
}

.os-meta {
  margin: 0 0 8px;
  font-size: var(--os-body);
  line-height: 1.55;
  color: var(--os-ink);
}

.os-head-pos {
  font-weight: 600;
  color: var(--os-ink-soft);
}

.os-head-ko {
  font-weight: 500;
  color: var(--os-ink);
}

/* cf. 연관어 (있을 때만) */
.os-cf {
  margin: 0 0 10px;
  font-size: var(--os-body);
  line-height: 1.55;
  color: var(--os-ink-muted);
}

.os-cf-label {
  font-style: italic;
  font-weight: 500;
  color: inherit;
}

.os-cf-en,
.os-cf-pos,
.os-cf-dash,
.os-cf-ko {
  font-weight: 400;
  color: inherit;
}

.os-en-row {
  margin-bottom: 4px;
}

.os-ko {
  margin: 4px 0 0;
  font-size: var(--os-body);
  line-height: 1.7;
  color: var(--os-ink-soft);
  font-weight: 400;
}

.os-en-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 0;
  min-width: 0;
}

.os-en {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: inherit;
  font-size: var(--os-body);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
  color: var(--os-ink);
}

.os-en mark {
  background: var(--os-hl);
  color: inherit;
  padding: 0 0.08em;
  border-radius: 2px;
  font-weight: 600;
}

.os-tts {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #9a968c;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}

.os-tts:hover,
.os-tts.is-playing {
  color: var(--os-blue);
  background: rgba(47, 111, 237, 0.08);
  opacity: 1;
}

.os-tts svg {
  width: 16px;
  height: 16px;
}

.os-empty {
  padding: 48px 0;
  text-align: left;
  color: var(--ink-muted);
  font-size: var(--os-body);
  line-height: 1.7;
}

.os-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin-top: 40px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}

.os-tags[hidden] {
  display: none !important;
}

.os-tag-letter {
  flex-basis: 100%;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #888;
}

.os-tags .os-tag-letter:first-child {
  margin-top: 0;
}

.os-tag {
  position: relative;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.os-tag:hover,
.os-tag:focus-visible {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
  z-index: 3;
}

.os-tag[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  z-index: 20;
  box-sizing: border-box;
  width: max-content;
  max-width: min(280px, 70vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: #2a2a2a;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}

.os-tag[data-tip]:hover::after,
.os-tag[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.os-item-flash {
  background: rgba(47, 111, 237, 0.06);
  border-radius: 8px;
  transition: background 0.9s ease;
}

.os-report {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.os-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  background: var(--surface);
  color: var(--os-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.os-report-btn:hover {
  border-color: var(--os-blue);
  color: var(--os-blue);
}

.os-report-mail {
  font-size: 14px;
  color: var(--os-ink-soft);
  text-decoration: none;
  word-break: break-all;
}

.os-report-mail:hover {
  color: var(--os-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 640px) {
  .os-main {
    padding: 32px 18px 88px;
  }

  .os-item {
    padding: 18px 0 16px;
  }

  .os-page {
    --os-body: 16px;
  }
}
