/* 내 글 단어장 — 따뜻한 종이 단어장 + 밝은 표지색 (2026-10-15 사용자 선택: A 바탕 + B 표지) */

:root {
  --bg: #f6f1e7;
  --paper: #fffdf8;
  --ink: #1f1b16;
  --ink-2: #5b5248;
  --ink-3: #8c8274;
  --line: #e4dccd;
  --accent: #d9481f;
  --accent-ink: #fff;
  --hl: rgba(255, 196, 0, 0.55);
  --chip: #efe7d8;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 0 rgba(31, 27, 22, 0.06), 0 6px 18px -10px rgba(31, 27, 22, 0.25);
  --f-en: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --f-ko: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --f-ipa: 'Noto Sans', 'Segoe UI', 'Lucida Sans Unicode', sans-serif;
  --head-weight: 600;
  --btn-depth: 0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--f-ko);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button { font: inherit; color: inherit; cursor: pointer; }
.en { font-family: var(--f-en); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 120px; }

/* ── 상단 ─────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.brand b { color: var(--accent); }
.top .sp { flex: 1; }

/* ── 단어장 머리 ───────────────────────── */
.book-head { padding: 28px 0 8px; }
.book-head .kicker { color: var(--ink-3); font-size: 13px; }
.book-head h1 { margin: 4px 0 6px; font-size: clamp(26px, 6vw, 36px); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.book-head .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.chip.lv { background: var(--ink); color: var(--paper); }

.sec-title { display: flex; align-items: baseline; gap: 8px; margin: 30px 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.04em; }
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── 원문 ─────────────────────────────── */
.source {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow);
  font-family: var(--f-en); font-size: 18px; line-height: 1.75;
}
.source p { margin: 0 0 0.6em; }
.source p:last-child { margin: 0; }
.source .w {
  border: 0; background: none; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  background-image: linear-gradient(var(--hl), var(--hl)); background-repeat: no-repeat;
  background-size: 0% 60%; background-position: 0 85%;
  transition: background-size 0.45s cubic-bezier(.2,.7,.2,1);
}
.source .w.lit, .quote mark { background-size: 100% 60%; }
@media (prefers-reduced-motion: reduce) { .source .w { transition: none; } }

/* ── 단어 카드 ────────────────────────── */
.cards { display: grid; gap: 14px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px 16px; box-shadow: var(--shadow); scroll-margin-top: 80px;
}
.card.flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hw { font-family: var(--f-en); font-size: 30px; font-weight: var(--head-weight); line-height: 1.1; letter-spacing: -0.01em; }
.ipa { font-family: var(--f-ipa); color: var(--ink-2); font-size: 15px; }
.say {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); display: grid; place-items: center;
  box-shadow: 0 var(--btn-depth) 0 var(--line);
}
.say:active { transform: translateY(var(--btn-depth)); box-shadow: none; }
.say svg { width: 18px; height: 18px; }
.card-head .lvl { margin-left: auto; }
.forms { color: var(--ink-3); font-size: 13px; margin-top: 2px; }

.senses { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.sense { display: grid; grid-template-columns: 26px 1fr; gap: 0 6px; }
.sense .no { font-family: var(--f-en); color: var(--accent); font-weight: 700; font-size: 15px; line-height: 1.6; }
.sense .mean { font-weight: 650; font-size: 16.5px; }
.pos { display: inline-block; min-width: 22px; padding: 0 5px; margin-right: 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: center; vertical-align: 1px; }
.ex { grid-column: 2; margin-top: 3px; padding-left: 10px; border-left: 2px solid var(--line); }
.ex .e { font-family: var(--f-en); font-style: italic; font-size: 16px; color: var(--ink); }
.ex .e b { font-style: normal; font-weight: 700; color: var(--accent); }
.ex .k { color: var(--ink-2); font-size: 14px; }

.quote { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--chip); font-size: 14px; }
.quote .lab { color: var(--ink-3); font-size: 12px; font-weight: 700; display: block; margin-bottom: 2px; }
.quote .q { font-family: var(--f-en); font-size: 15.5px; }
.quote mark { color: inherit; background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 85% / 100% 60%; }
.nodict { color: var(--ink-3); font-size: 14px; margin-top: 8px; }

/* ── 책장 ─────────────────────────────── */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; padding-top: 6px; }
.nb { border: 0; padding: 0; background: none; text-align: left; }
.nb .cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: 4px 10px 10px 4px; padding: 16px 14px 12px 22px;
  color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  box-shadow: inset 6px 0 0 rgba(0,0,0,.18), 0 10px 20px -12px rgba(0,0,0,.45);
}
.nb .cover::before { content: ''; position: absolute; inset: 0 auto 0 10px; width: 1px; background: rgba(255,255,255,.25); }
.nb .label { background: var(--paper); color: var(--ink); border-radius: 3px; padding: 8px 9px; font-size: 14px; font-weight: 700; line-height: 1.3; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.nb .label small { display: block; margin-top: 3px; font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.nb .count { font-family: var(--f-en); font-size: 30px; font-weight: 600; line-height: 1; }
.nb .count small { font-family: var(--f-ko); font-size: 12px; font-weight: 600; opacity: .85; margin-left: 3px; }

/* ── 아래 탭 ──────────────────────────── */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs nav { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabs a { display: grid; justify-items: center; gap: 1px; padding: 8px 0 7px; font-size: 11.5px; color: var(--ink-3); text-decoration: none; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a.on { color: var(--ink); font-weight: 700; }
.tabs a.add span.plus {
  width: 42px; height: 42px; margin-top: -16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 var(--btn-depth) 0 color-mix(in srgb, var(--accent) 70%, #000), 0 6px 14px -6px var(--accent);
}
