/* 미닝렌즈 매거진 웹: 사주토끼 스토리(sajurabbit.com/blog) 구조를 따른다.
   첫 화면 = 사진 카드 격자(1·2·3열), 글 = 흰 바탕 680px 한 단에 글만. 색은 스티비 메일의 진녹 #142019 · 민트 #18C86D를 포인트로만. */
:root {
  --paper: #FFFFFF;
  --ink: #142019;
  --body: #3E4C45;
  --muted: #68756D;
  --line: #EDEFEE;
  --mint: #18C86D;
  --green: #0B7A40;
  --soft: #F3F8F5;
  --dark-muted: #8FA197;
  --ko: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 16px/1.75 var(--ko); letter-spacing: -0.02em; word-break: keep-all; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* 맨 위 막대 */
.top { border-bottom: 1px solid var(--ink); }
.top .wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; }
.top .logo { font-size: 17px; font-weight: 800; text-decoration: none; }

/* 글 한 편 */
main { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.post { padding: 48px 0 8px; }
.crumb { font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb span { margin: 0 10px; color: #C9CFCB; }
.hero h1 { margin-top: 20px; font-size: clamp(30px, 7vw, 42px); line-height: 1.22; font-weight: 800; letter-spacing: -0.03em; }
.post .lede { margin-top: 20px; font-size: 17px; line-height: 1.8; color: var(--body); }
.hero { padding-bottom: 8px; }

.post h2 { font-size: clamp(22px, 5vw, 26px); line-height: 1.4; font-weight: 800; margin-top: 56px; }
.post p { font-size: 17px; line-height: 1.85; color: var(--body); }
.post h2 + p, .post p + p { margin-top: 14px; }
.post b { color: var(--ink); }
.post h2 .sec { display: block; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--green); margin-bottom: 6px; }
.post ol.plain, .post ul.plain { margin-top: 14px; padding-left: 1.3em; display: grid; gap: 8px; color: var(--body); font-size: 17px; }

/* 마디 이름(하린의 이야기 · 이야기 속 심리학 · 이번 연구) */
.post .label { display: flex; align-items: center; gap: 12px; margin-top: 64px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.post .label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 장면: 소제목 → 그림 → 글 */
.scene { margin-top: 48px; }
.label + .scenes .scene:first-child { margin-top: 20px; }
.post .scene h2 { margin-top: 0; }
.scene img { width: 100%; height: auto; margin-top: 16px; background: #FAFAFA; }
.scene p { margin-top: 16px; }

/* 상자 */
.paper-card { margin-top: 24px; border-top: 1px solid var(--ink); }
.paper-card div { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.paper-card dt { font-size: 12.5px; color: var(--green); padding-top: 3px; }
.paper-card dd { font-size: 15px; color: var(--ink); }
.paper-card dd i { display: block; color: var(--muted); font-size: 14px; font-style: normal; }
.insight, .tldr { margin-top: 20px; padding: 24px 22px; background: var(--soft); }
.post .insight h2 { margin-top: 0; font-size: 19px; }
.insight ul, .tldr ul { margin-top: 12px; padding-left: 1.2em; display: grid; gap: 8px; color: var(--body); }
.post .insight .src { margin-top: 14px; font-size: 13px; color: var(--muted); }
.term { margin-top: 24px; padding: 18px 20px; border: 1px solid var(--line); }
.term b { display: block; }
.post .term p { margin-top: 6px; font-size: 15.5px; }
.pull { margin-top: 28px; padding-left: 18px; border-left: 3px solid var(--mint); }
.post .pull p { font-weight: 700; font-size: 17px; color: var(--ink); }
.post .pull p[lang="en"] { font-weight: 400; font-size: 14px; line-height: 1.7; color: var(--muted); margin-top: 8px; }
.pull cite { display: block; margin-top: 8px; font-style: normal; font-size: 13px; color: var(--muted); }
.bignum { margin-top: 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; padding: 24px 18px; background: var(--ink); color: #fff; text-align: center; }
.bignum span { display: block; font-size: clamp(44px, 12vw, 60px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--mint); font-variant-numeric: tabular-nums; }
.bignum div:last-of-type span { color: #fff; }
.bignum small { font-size: 18px; margin-left: 2px; }
.bignum b { display: block; margin-top: 8px; font-size: 14px; color: #fff; }
.bignum .vs { color: var(--dark-muted); padding-bottom: 28px; }
.post .bignum p { grid-column: 1 / -1; font-size: 13px; color: var(--dark-muted); }
.oneline { margin-top: 40px; padding: 4px 0 4px 18px; border-left: 3px solid var(--mint); }
.oneline b { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--green); }
.post .oneline p { margin-top: 6px; color: var(--ink); font-weight: 700; }

/* 표·막대 */
.chart { margin-top: 28px; border-top: 1px solid var(--ink); }
.chart .cap-title { display: block; font-weight: 700; padding: 12px 0 2px; font-size: 15px; }
.chart figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.rows { list-style: none; }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows b { font-weight: 700; }
.rows small { grid-column: 1; font-size: 14px; color: var(--muted); }
.rows .val { grid-row: 1; grid-column: 2; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--green); text-align: right; }
.rows .val.no { color: var(--muted); font-weight: 400; }
.rows .bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.rows .bar i { display: block; height: 100%; width: var(--w); background: var(--mint); border-radius: inherit; }
.rows li.dim .bar i { background: #A9E7C6; }
.rows li.me b { color: var(--green); }
.tbl { margin-top: 28px; overflow-x: auto; }
.tbl table { border-collapse: collapse; width: 100%; min-width: 440px; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--body); }
.tbl thead th { font-weight: 400; font-size: 12px; color: var(--muted); border-top: 1px solid var(--ink); }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl tr.me td { color: var(--green); font-weight: 700; }
.tbl figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* 논문 자세히 보기: 닫힌 채로 시작 */
.deep { margin-top: 20px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.deep > summary { cursor: pointer; list-style: none; padding: 18px 0; font-size: 17px; font-weight: 800; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.deep > summary::-webkit-details-marker { display: none; }
.deep > summary span { font-size: 13px; font-weight: 400; color: var(--muted); }
.deep > summary::after { content: "펼치기 ▾"; margin-left: auto; font-size: 13px; font-weight: 700; color: var(--green); }
.deep[open] > summary::after { content: "접기 ▴"; }
.deep[open] { padding-bottom: 28px; }

/* 뒤쪽 */
.refs { list-style: none; margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: grid; gap: 8px; }
.refs li { padding-left: 2em; text-indent: -2em; overflow-wrap: anywhere; }
.post-cta { margin-top: 48px; }
.post-cta .wrap { background: var(--soft); padding: 24px 22px; }
.post-cta h2 { font-size: 18px; line-height: 1.5; font-weight: 800; }
.post-cta p { margin-top: 8px; font-size: 15px; color: var(--body); }
.btn { display: inline-block; margin-top: 16px; padding: 12px 22px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; }
.btn:hover { background: #000; }
.post-next { margin-top: 72px; border-top: 1px solid var(--ink); padding-top: 28px; }
.post-next h2 { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.next { list-style: none; margin-top: 8px; }
.next li + li { border-top: 1px solid var(--line); }
.next a { display: flex; align-items: flex-start; gap: 16px; padding: 18px 0; text-decoration: none; }
.next .mini { flex: none; width: 76px; aspect-ratio: 4 / 5; overflow: hidden; background: var(--soft); }
.next .mini img { width: 100%; height: 100%; object-fit: cover; }
.next .mini span { display: none; }
.next b { display: block; font-size: 16px; font-weight: 800; line-height: 1.45; }
.next a div + div span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 13.5px; line-height: 1.6; color: var(--body); }
.next a:hover b { text-decoration: underline; }
.foot { max-width: 680px; margin: 64px auto 0; padding: 0 20px 40px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.foot .wrap { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }

/* 매거진 첫 화면 */
main.home { max-width: 1140px; padding-bottom: 24px; }
.home-intro { padding: 48px 0; }
.eyebrow { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.home-intro h1 { margin-top: 12px; font-size: clamp(44px, 10vw, 60px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.home-intro p:last-child { margin-top: 20px; font-size: 16px; line-height: 1.7; color: var(--body); }
/* 첫 화면은 날짜순이 아니라 주제별 서가로 묶는다 */
.shelf + .shelf { margin-top: 88px; }
.shelf-h { display: flex; align-items: baseline; gap: 10px; padding-top: 20px; margin-bottom: 32px; border-top: 1px solid var(--line); font-size: clamp(24px, 5.6vw, 28px); font-weight: 800; letter-spacing: -0.02em; }
.shelf-h span { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.cards { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px 32px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cards > li > a { display: block; text-decoration: none; }
.thumb { aspect-ratio: 4 / 5; overflow: hidden; background: #FAFAFA; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease-out; }
.cards a:hover .thumb img { transform: scale(1.03); }
.thumb.cover { background: var(--soft); display: flex; align-items: flex-end; padding: 24px; }
.thumb.cover span { font-size: 22px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.thumb.cover small { display: block; margin-top: 10px; font-size: 12px; font-weight: 400; color: var(--muted); }
.cards .cat { display: block; margin-top: 20px; font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.cards h3 { margin-top: 10px; font-size: clamp(20px, 4.6vw, 22px); line-height: 1.35; font-weight: 800; }
.cards a:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; }
.cards p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 10px; font-size: 14px; line-height: 1.65; color: var(--body); }
.tags { list-style: none; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.tags li::before { content: "#"; margin-right: 2px; color: var(--mint); }

@media (max-width: 420px) {
  .paper-card div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

main.home + .foot { max-width: 1140px; }

/* 용어 상자: 논문 원문 → 번역 → 쉽게 말하면 */
.post .term .orig { margin-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--green); }
.post .term p[lang="en"] { font-size: 14px; line-height: 1.7; color: var(--muted); }

/* 문라이트식 논문 카드(비교용 시안) */
.ml { margin-top: 20px; padding: 24px 22px; border: 1px solid var(--line); border-top: 2px solid var(--ink); }
.ml-cat { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--green); font-size: 12px; font-weight: 700; }
.post .ml-title { margin-top: 12px; font-size: 18px; line-height: 1.45; letter-spacing: -0.01em; }
.post .ml-ko { margin-top: 4px; font-size: 15px; color: var(--muted); }
.post .ml-by { margin-top: 10px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.ml-terms { list-style: none; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.ml-terms li { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--body); }
.ml h3 { margin-top: 22px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--green); }
.post .ml h3 + p { margin-top: 6px; font-size: 16px; }
.ml ul.found { margin-top: 6px; padding-left: 1.2em; display: grid; gap: 8px; color: var(--body); font-size: 16px; line-height: 1.8; }
.ml-links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.ml-links a { padding: 9px 16px; border: 1px solid var(--ink); border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; }

/* 글 끝 의견 버튼 */
.fb { margin-top: 48px; padding: 24px 22px; border: 1px solid var(--line); text-align: center; }
.fb h2 { font-size: 17px; font-weight: 800; }
.fb-btns { margin-top: 14px; display: flex; justify-content: center; gap: 8px; }
.fb button { font: inherit; cursor: pointer; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font-size: 15px; font-weight: 700; }
.fb button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.fb-more { margin-top: 16px; display: grid; gap: 8px; text-align: left; }
.fb-more label { font-size: 14px; color: var(--body); }
.fb-more textarea { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.fb-more button { justify-self: end; background: var(--ink); color: #fff; }
.fb-done { margin-top: 14px; font-size: 15px; color: var(--green); font-weight: 700; }
.fb [hidden] { display: none; }
.post .pull + p { margin-top: 16px; }
.post .ml-note { margin-top: 14px; font-size: 14.5px; line-height: 1.75; color: var(--body); }
.ml-note b { display: block; font-size: 12px; letter-spacing: .04em; color: var(--green); }
.fb .n { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: .7; }
.fb .n:empty { display: none; }
.deep .ml { margin-top: 0; padding: 4px 0 0; border: 0; }

/* 로그인 · 글 잠금 · 내 기록 창 (worker.js 가 HTMLRewriter 로 끼워 넣는다) */
.top .acct-btn { margin-left: auto; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.4; padding: 6px 14px; border: 1px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; }
.top .acct-btn.on { background: var(--ink); color: #fff; }
.top .acct-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.gate { position: relative; margin-top: -96px; }
.gate::before { content: ""; display: block; height: 96px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.gate-card { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px 20px; box-shadow: 0 6px 20px rgba(20, 32, 25, .08); }
.post .gate-card h2 { margin-top: 0; font-size: 19px; }
.gate .gate-p { margin-top: 6px; font-size: 14.5px; color: var(--body); }
.gate .gate-s, .acct .gate-s { margin-top: 14px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.gate .gate-err, .acct .gate-err { margin-top: 12px; font-size: 14px; font-weight: 700; color: #B3261E; }
.login-kakao, .login-google, .login-naver { display: block; margin-top: 10px; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 800; text-align: center; text-decoration: none; }
.login-kakao { background: #FEE500; color: #191600; }
.login-google { background: #fff; color: var(--ink); border: 1px solid #C9CFCB; }
.login-naver { background: #03C75A; color: #fff; }
.login-naver b { display: inline-block; margin-right: 8px; font-family: Arial, sans-serif; font-weight: 900; }
.login-kakao:focus-visible, .login-google:focus-visible, .login-naver:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

dialog.acct { margin: auto; border: 0; padding: 0; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 32px); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 12px 40px rgba(20, 32, 25, .25); }
dialog.acct::backdrop { background: rgba(20, 32, 25, .45); }
.acct-in { padding: 20px; display: grid; gap: 8px; }
.acct-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.acct-head h2 { font-size: 18px; font-weight: 800; }
.acct-head h2 span { font-size: 12px; font-weight: 600; color: var(--muted); }
.acct button { font: inherit; cursor: pointer; }
.acct-x, .acct-foot button, .acct-del button { padding: 6px 12px; border: 1px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; }
.acct-sub { margin-top: 8px; font-size: 12.5px; font-weight: 800; color: var(--green); }
.acct-info { margin-top: -4px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.acct-list { list-style: none; display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.acct-list li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; font-size: 12.5px; }
.acct-list a { font-weight: 700; text-decoration: none; }
.acct-list span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.acct-list .acct-empty { border: 0; color: var(--muted); }
#acct-msg { display: grid; gap: 8px; }
#acct-msg textarea, #acct-msg input { font: inherit; font-size: 14px; padding: 9px 10px; border: 1px solid #C9CFCB; border-radius: 8px; width: 100%; }
#acct-msg textarea { resize: vertical; }
.acct-send { padding: 10px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; }
.acct-status { min-height: 1.4em; font-size: 13px; color: var(--green); font-weight: 700; }
.acct-foot { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.acct-del { margin-top: 4px; padding: 12px; background: var(--soft); border-radius: 8px; font-size: 13.5px; }
.acct-del div { margin-top: 10px; display: flex; gap: 8px; }
.acct-del button:first-child { background: #B3261E; border-color: #B3261E; color: #fff; }
.acct-del[hidden] { display: none; }
.acct-err { font-size: 13px; font-weight: 700; color: #B3261E; }
.acct-err:empty { display: none; }
.notice { max-width: 680px; margin: 16px auto 0; padding: 12px 16px; border-radius: 8px; background: var(--soft); color: var(--ink); font-size: 14.5px; font-weight: 700; }
@media (max-width: 720px) { .notice { margin: 16px 20px 0; } }
