/* =========================================================
   주소다 - 링크모음 페이지 (links.html)
   ========================================================= */
:root {
  --bg: #fffaf2;
  --card: #ffffff;
  --line: #eadbc4;
  --line-soft: #f3e9da;
  --ink: #2c1a0e;
  --brown: #4a2c1a;
  --brown-2: #6b4423;
  --orange: #d97706;
  --orange-soft: #fde8c8;
  --cream: #fdf3e3;
  --muted: #8a7462;
  --faint: #c9b79f;
  --gold: #a85f00;
  --silver: #607080;
  --bronze: #9a4f2b;
  --shadow: 0 2px 7px rgba(122, 84, 40, .11);
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 12px; }

/* ---------- 상단 바 ---------- */
.topbar {
  background: linear-gradient(90deg, var(--brown) 0%, var(--brown-2) 100%);
  color: #fff3e0; font-size: 13px;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.topbar .notice { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.topbar .notice .tg {
  width: 20px; height: 20px; border-radius: 50%;
  background: #2aa3e0; display: grid; place-items: center;
}
.topbar .domain { display: flex; align-items: center; gap: 8px; }
.topbar .domain span {
  background: rgba(255, 243, 224, .18); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.topbar .domain b { color: #ffb84d; }

/* ---------- 헤더 ---------- */
.header { background: linear-gradient(#ffffff 0%, var(--bg) 100%); }
.header .wrap { display: flex; align-items: center; justify-content: center; gap: 16px; height: 74px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6e6, #f5d7a1);
  border: 2px solid #e8c48a; display: grid; place-items: center; color: var(--orange);
}
.logo b { font-size: 28px; font-weight: 900; color: var(--brown); letter-spacing: -.03em; }
.tagline { padding-left: 16px; border-left: 1px solid var(--line); font-size: 13px; color: var(--brown-2); }
.tagline strong { color: var(--orange); }

/* ---------- 카테고리 메뉴 ---------- */
.catnav {
  position: sticky; top: 0; z-index: 40;
  background: #fff; box-shadow: 0 2px 10px rgba(122, 84, 40, .07);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.catnav .wrap { display: flex; overflow-x: auto; padding: 0; scrollbar-width: none; }
.catnav .wrap::-webkit-scrollbar { display: none; }
.catnav a {
  flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 0 14px; font-size: 14px; font-weight: 700; color: var(--brown);
  border-right: 1px solid var(--line-soft); white-space: nowrap;
}
.catnav a:last-child { border-right: 0; }
.catnav a:hover { background: var(--cream); color: var(--orange); }
.catnav .ic { flex: none; }

/* 아이콘 공통 */
.ic { display: block; flex: none; }
.ic-19 {
  flex: none; width: 19px; height: 19px; border-radius: 50%;
  border: 2px solid #e11d48; color: #e11d48; background: #fff;
  display: grid; place-items: center; font-size: 9px; font-weight: 900; letter-spacing: -.04em;
}

/* ---------- 본문 ---------- */
.main { padding: 16px 12px 40px; }

.guaranteed-heading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  height: 42px; font-size: 18px; font-weight: 800; margin-bottom: 10px;
}
.guaranteed-heading strong { color: var(--orange); }
.guaranteed-heading .trophy { color: #d4a017; }

/* 배너 */
.banners { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.banner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 612 / 100; background: #fff; border: 1px solid rgba(196, 139, 55, .35);
  border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; text-align: center;
  transition: transform .15s, border-color .15s;
}
.banner:hover { transform: translateY(-1px); border-color: var(--orange); }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner b { font-size: 16px; color: var(--brown); }
.banner small { font-size: 12px; color: var(--muted); }
.banner.empty { color: var(--faint); font-size: 13px; font-weight: 600; box-shadow: none; border-style: dashed; }

/* 빠른 바로가기 */
.quick {
  display: grid; grid-template-columns: repeat(8, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 28px;
}
.quick a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; font-size: 13px; font-weight: 600; color: var(--brown-2);
  border-right: 1px solid var(--line-soft);
}
.quick a:last-child { border-right: 0; }
.quick a:hover { background: var(--cream); }
.quick svg { flex: none; }
.q-letter {
  width: 18px; height: 18px; border-radius: 5px; background: var(--brown-2); color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
}

/* 섹션 제목 */
.dir-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 2px solid var(--brown);
}
.dir-head .eyebrow { font-size: 11px; font-weight: 700; color: var(--orange); margin-bottom: 4px; }
.dir-head h2 { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.dir-head p { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- 카테고리 카드 ---------- */
.directory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.cat-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); scroll-margin-top: 64px;
}
.cat-card.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--orange); } 100% { box-shadow: var(--shadow); } }

.cat-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px;
  background: linear-gradient(#fffdf8, #fff7ea); border-bottom: 1px solid var(--line-soft);
}
.cat-head .ic-19 { width: 21px; height: 21px; }
.cat-name { flex: 1; font-size: 15px; font-weight: 800; color: var(--brown); }
.cat-count {
  background: var(--orange-soft); color: var(--orange);
  border-radius: 20px; padding: 2px 8px; font-size: 11px; font-weight: 800;
}

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { border-bottom: 1px solid var(--line-soft); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list li.extra { display: none; }
.cat-card.open .cat-list li.extra { display: block; }
.cat-list a { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; font-size: 13.5px; }
.cat-list a:hover { background: var(--cream); }
.cat-list a:hover .ext { color: var(--orange); }

.link-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.top1 .link-label { color: var(--gold); font-weight: 800; }
.top2 .link-label { color: var(--silver); font-weight: 800; }
.top3 .link-label { color: var(--bronze); font-weight: 800; }
.ext { font-size: 10px; color: var(--faint); }

.rank {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
  background: #fff3e3; color: var(--orange); border: 1px solid #f4d3a5;
}
.rank.medal { color: #fff; border: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.rank.m1 { background: linear-gradient(#ffd54a, #e8a400); }
.rank.m2 { background: linear-gradient(#d6dde4, #8e9aa6); }
.rank.m3 { background: linear-gradient(#e7a774, #b5652f); }

.cat-more {
  display: block; width: 100%; padding: 10px 0; cursor: pointer;
  background: var(--cream); border: 0; border-top: 1px solid var(--line);
  color: var(--orange); font: inherit; font-size: 12.5px; font-weight: 800;
}
.cat-more:hover { background: var(--orange-soft); }

/* ---------- 푸터 ---------- */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 24px 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.footer p { margin: 4px 0; }
.footer a { color: var(--brown-2); font-weight: 600; }

.top-btn {
  position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(74, 44, 26, .55); color: #fff; border: 0; cursor: pointer; font-size: 18px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.top-btn.show { opacity: 1; pointer-events: auto; }

/* ---------- 반응형 ---------- */
@media (max-width: 1024px) { .directory { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .directory { grid-template-columns: repeat(2, 1fr); }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .quick a:nth-child(4) { border-right: 0; }
  .quick a:nth-child(-n+4) { border-bottom: 1px solid var(--line-soft); }
  .tagline { display: none; }
}
@media (max-width: 480px) {
  .directory { grid-template-columns: 1fr; }
  .banners { grid-template-columns: 1fr; }
  .topbar .notice span { display: none; }
}
