/* ─────────────────────────────────────────────────────────────
   공용 디자인 시스템 (gamenews1/gl-design.php 와 같은 토큰·같은 규칙)

   지켜야 할 규칙
    1. 카드 안에 또 테두리를 치지 않는다. 구획은 선이 아니라 여백으로 나눈다.
    2. 제목과 내용은 세로로 쌓는다. 한 줄에 욱여넣지 않는다.
    3. 강약을 확실히. 중요한 건 확 키우고 나머지는 눌러 둔다. 12px 이하는 안 쓴다.
    4. 그림자는 떠야 할 것 하나에만. 글래스 효과는 안 쓴다.
    5. 썸네일 비율을 하나로 통일한다. 손가락이 닿는 것은 최소 44px.

   이 파일은 모든 쪽이 읽는다. 시뮬레이터 전용 규칙은 style.css 에 있다.
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── 서체 ───────────────────────────────────────────────────────
   넥슨이 무료 배포하는 메이플스토리 공식 서체. 상업적 이용이 허용된다.
   폰트 파일 자체를 재배포·판매하지는 않는다.

   ★ 본문에는 쓰지 않는다. 개성이 강해 1,500자짜리 글에 통으로 깔면
     읽기 힘들다. 제목·로고·시뮬레이터 UI 처럼 눈에 띄어야 하는 자리에만
     쓰고 본문은 시스템 폰트로 둔다. 강약을 만드는 것이 목적이다.

   ★ 서브셋(글자 잘라내기)을 하지 않았다. 시뮬레이터가 아이템 이름을
     API 로 받아 뿌리기 때문에 미리 자르면 목록에 없는 글자가 □ 로 깨진다.
   ───────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Maplestory';
  src: url('/static/fonts/maplestory-light.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Maplestory';
  src: url('/static/fonts/maplestory-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── 토큰 ───────────────────────────────────────────────────── */
:root {
  --ink:   #111318;
  --sub:   #565e6b;
  --faint: #858d9a;
  --key:   #2563eb;
  --key-hover: #1d4ed8;
  --soft:  #f4f5f7;
  --line:  rgba(0,0,0,.08);
  --bg:    #ffffff;

  --key-soft: #eaf1fe;
  --key-line: #c7dbfd;
  --up:   #d92d20;
  --down: #1570ef;
  --warn: #b54708;
  --warn-soft: #fef6ee;
  --good: #067647;

  /* 여백은 8의 배수로만 */
  --s1: 8px; --s2: 12px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;

  /* 라운딩은 세 개로 고정 */
  --r-sm: 8px; --r-md: 12px; --r-full: 999px;

  --tap: 44px;

  /* 눈에 띄어야 하는 자리에만 쓰는 서체. 폴백을 반드시 남긴다 */
  --font-display: 'Maplestory', system-ui, -apple-system, 'Malgun Gothic', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Pretendard", "Noto Sans KR", "맑은 고딕", "Malgun Gothic", sans-serif;
  --font-num: var(--font-body);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f4f7; --sub: #a8b0bc; --faint: #7d858f;
    --soft: rgba(255,255,255,.06); --line: rgba(255,255,255,.12);
    --bg: #0f1216;
    --key-soft: rgba(37,99,235,.16); --key-line: rgba(37,99,235,.42);
    --warn-soft: rgba(181,71,8,.18);
    --good: #3ccb7f;
  }
}

/* ── 바탕 ───────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--key); }

/* ── 상단 바 ───────────────────────────────────────────────────
   원색을 넓게 깔지 않는다. 시야를 훔쳐 본문이 안 읽힌다.        */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav__in {
  max-width: 960px; margin: 0 auto;
  padding: 0 var(--s4);
  display: flex; align-items: center; gap: var(--s4);
  min-height: 56px;
}
.nav__b {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700; letter-spacing: -.03em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; min-height: var(--tap);
}
.nav__m {
  display: flex; align-items: center; gap: 2px;
  margin-left: auto;
  overflow-x: auto; scrollbar-width: none;
}
.nav__m::-webkit-scrollbar { display: none; }
.nav__m a {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 var(--s2);
  font-size: 15px; font-weight: 600; color: var(--sub);
  text-decoration: none; border-radius: var(--r-sm);
  white-space: nowrap;
}
.nav__m a:hover { color: var(--ink); background: var(--soft); }
.nav__m a.on { color: var(--key); }

@media (max-width: 560px) {
  .nav__in { padding: 0 var(--s3); gap: var(--s2); }
  .nav__b { font-size: 16px; }
  .nav__m a { padding: 0 var(--s1); font-size: 14px; }
}

/* ── 본문 그릇 ─────────────────────────────────────────────── */
.wrap { flex: 1; }
.doc {
  max-width: 720px; margin: 0 auto;
  padding: var(--s6) var(--s4) var(--s7);
}
/* 넓은 그릇. 격자·카드가 들어가는 자리에 쓴다.
   다만 글줄이 960px 로 늘어나면 눈이 줄을 놓치므로 문단만 따로 묶어 둔다. */
.doc--wide { max-width: 960px; }
.doc--wide > p, .doc--wide > ul, .doc--wide > ol { max-width: 680px; }

/* ── 문서 제목 ─────────────────────────────────────────────── */
.doc__kicker {
  font-size: 14px; font-weight: 700; color: var(--key);
  letter-spacing: .01em; margin-bottom: var(--s1);
}
.doc h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.24;
  color: var(--ink);
  word-break: keep-all; overflow-wrap: break-word;
}
.doc__lead {
  margin-top: var(--s3);
  font-size: 18px; line-height: 1.72; color: var(--sub);
  word-break: keep-all; overflow-wrap: break-word;
}
.doc__meta {
  margin-top: var(--s4);
  font-size: 14px; color: var(--faint);
}

/* 소제목. 선을 긋지 않고 여백과 크기로 구획한다 */
.doc h2 {
  font-family: var(--font-display);
  margin: var(--s6) 0 var(--s2);
  font-size: 24px; font-weight: 700; letter-spacing: -.025em;
  line-height: 1.32; color: var(--ink);
  word-break: keep-all; overflow-wrap: break-word;
}
.doc h3 {
  margin: var(--s5) 0 var(--s1);
  font-size: 18px; font-weight: 700; letter-spacing: -.015em; color: var(--ink);
}
.doc p {
  margin: var(--s2) 0;
  font-size: 17px; line-height: 1.82; color: var(--sub);
  word-break: keep-all; overflow-wrap: break-word;
}
.doc p strong, .doc li strong { color: var(--ink); font-weight: 700; }
.doc ul, .doc ol { margin: var(--s2) 0; padding-left: 22px; }
.doc li {
  font-size: 17px; line-height: 1.82; color: var(--sub);
  margin: 6px 0;
  word-break: keep-all; overflow-wrap: break-word;
}
.doc li::marker { color: var(--faint); }
.doc a { color: var(--key); text-underline-offset: 3px; }
.doc hr {
  border: 0; border-top: 1px solid var(--line);
  margin: var(--s6) 0;
}
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .94em; background: var(--soft);
  padding: 2px 6px; border-radius: 6px; color: var(--ink);
}

@media (max-width: 560px) {
  .doc { padding: var(--s5) var(--s3) var(--s6); }
  .doc__lead { font-size: 16.5px; }
  .doc h2 { font-size: 21px; margin-top: var(--s5); }
  .doc h3 { font-size: 17px; }
  .doc p, .doc li { font-size: 16px; }
}

/* ── 표 ─────────────────────────────────────────────────────
   수치를 이미지로 굽지 않는다. 검색에 안 잡히고 고치기도 어렵다.  */
.tbl-scroll { overflow-x: auto; margin: var(--s4) 0; -webkit-overflow-scrolling: touch; }
.tbl {
  width: 100%; min-width: 420px;
  border-collapse: separate; border-spacing: 0;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  font-size: 15px;
}
.tbl thead th {
  background: var(--key-soft); color: var(--ink);
  font-size: 14px; font-weight: 800; text-align: left;
  padding: 13px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--key-line);
}
.tbl tbody td {
  padding: 13px 14px; border-top: 1px solid var(--line);
  color: var(--sub); vertical-align: middle;
}
.tbl tbody tr:first-child td { border-top: 0; }
.tbl td.k { color: var(--ink); font-weight: 700; white-space: nowrap; }
.tbl td.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink);
  white-space: nowrap; font-size: 14.5px;
}
.tbl caption {
  caption-side: bottom; text-align: left;
  padding-top: var(--s1); font-size: 14px; color: var(--faint);
}
@media (prefers-color-scheme: dark) { .tbl { background: #161a20; } }

/* ── 수치 카드 ─────────────────────────────────────────────── */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s2); margin: var(--s4) 0;
}
.stat {
  position: relative; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s3) var(--s3) var(--s3) 18px; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--key);
}
.stat .lbl { font-size: 13px; font-weight: 700; color: var(--faint); }
.stat .val {
  font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2;
  color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px;
}
.stat .val small { font-size: 14px; font-weight: 700; color: var(--sub); margin-left: 3px; }
.stat .sub { font-size: 13px; color: var(--sub); margin-top: 4px; }
.stat.is-up::before   { background: var(--up); }
.stat.is-up .val      { color: var(--up); }
.stat.is-down::before { background: var(--down); }
.stat.is-down .val    { color: var(--down); }
@media (prefers-color-scheme: dark) { .stat { background: #161a20; } }

/* ── 콜아웃. 글 하나에 하나만 ──────────────────────────────── */
.callout {
  display: flex; gap: var(--s3);
  background: var(--key-soft);
  border: 1px solid var(--key-line); border-left: 4px solid var(--key);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4); margin: var(--s4) 0;
}
.callout .ico {
  flex: none; width: 28px; height: 28px; border-radius: var(--r-full);
  background: var(--key); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.callout h4 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--ink); }
.callout p  { margin: 0; font-size: 15px; line-height: 1.7; color: var(--sub); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout li { font-size: 15px; line-height: 1.7; color: var(--sub); margin: 3px 0; }
.callout.warn {
  background: var(--warn-soft);
  border-color: rgba(181,71,8,.3); border-left-color: var(--warn);
}
.callout.warn .ico { background: var(--warn); }

/* ── 섹션 제목 ─────────────────────────────────────────────── */
.head {
  display: flex; align-items: flex-end; gap: var(--s4);
  margin-bottom: var(--s4); flex-wrap: wrap;
}
.head__l { min-width: 0; }
.head h2 {
  font-family: var(--font-display);
  margin: 0; font-size: 27px; font-weight: 700;
  letter-spacing: -.03em; color: var(--ink); line-height: 1.25;
  word-break: keep-all; overflow-wrap: break-word;
}
.head__l p { margin: 6px 0 0; font-size: 15px; color: var(--sub); }
.head__m {
  margin-left: auto; font-size: 15px; font-weight: 600; color: var(--key);
  text-decoration: none;
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding-left: var(--s2);
}
.head__m::after { content: "›"; margin-left: 6px; font-size: 18px; line-height: 1; }
@media (max-width: 560px) { .head h2 { font-size: 22px; } }

/* ── 글 카드 (테두리 없음. 여백으로만 구분) ────────────────── */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4) var(--s5); }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; gap: var(--s4); } }

.card {
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: inherit; min-width: 0;
  padding: var(--s2) 0; min-height: var(--tap);
}
.card__k {
  font-size: 13px; font-weight: 700; color: var(--key);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__t {
  font-size: 19px; font-weight: 700; line-height: 1.42;
  letter-spacing: -.02em; color: var(--ink);
  word-break: keep-all; overflow-wrap: break-word;
}
.card:hover .card__t { color: var(--key); }
.card__e {
  font-size: 15px; line-height: 1.7; color: var(--sub);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── 다음 글 줄 ────────────────────────────────────────────── */
.morelist { display: flex; flex-direction: column; gap: var(--s1); margin-top: var(--s3); }
.morelist a {
  display: flex; align-items: center;
  min-height: var(--tap); padding: var(--s1) var(--s2);
  margin: 0 calc(var(--s2) * -1);
  border-radius: var(--r-sm);
  font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none;
  line-height: 1.45;
}
.morelist a:hover { background: var(--soft); color: var(--key); }
.morelist a::before { content: "›"; color: var(--faint); margin-right: var(--s1); }

/* ── 버튼 ─────────────────────────────────────────────────── */
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 var(--s4);
  background: var(--key); color: #fff;
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  border: 0; border-radius: var(--r-sm); text-decoration: none;
  cursor: pointer;
}
.cta:hover { background: var(--key-hover); }
.cta--ghost { background: var(--soft); color: var(--ink); }
.cta--ghost:hover { background: var(--line); color: var(--ink); }

/* ── 푸터 ─────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line);
  margin-top: var(--s7);
  padding: var(--s5) var(--s4) var(--s6);
}
.foot__in {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column; gap: var(--s3);
}
.foot__links { display: flex; flex-wrap: wrap; gap: 2px var(--s1); margin: 0 -10px; }
.foot__links a {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 10px;
  font-size: 15px; font-weight: 600; color: var(--sub);
  text-decoration: none; border-radius: var(--r-sm);
}
.foot__links a:hover { color: var(--key); background: var(--soft); }
.foot__legal { font-size: 14px; line-height: 1.75; color: var(--faint); }
.foot__legal strong { display: block; color: var(--sub); font-weight: 600; }
.foot__c { font-size: 14px; color: var(--faint); }

/* ── 등장 모션 ────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .anim > * { animation: rise .5s cubic-bezier(.22,1,.36,1) both; }
  .anim > *:nth-child(2) { animation-delay: .05s; }
  .anim > *:nth-child(3) { animation-delay: .1s; }
  .anim > *:nth-child(4) { animation-delay: .15s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
