/* 자미두수 암기장 — 모바일 우선 */

:root {
  --bg: #f6f6fa;
  --surface: #ffffff;
  --ink: #1f2433;
  --ink-2: #4b5165;
  --ink-3: #8a8fa3;
  --line: #e7e8ef;
  --primary: #2f4a9e;
  --primary-soft: #e8edfb;

  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", "Segoe UI", sans-serif;
  --serif: "Noto Serif CJK KR", "Noto Serif KR", "Noto Serif TC", "AppleMyungjo", "Songti TC", "Batang", serif;

  --radius: 16px;
  --gutter: 16px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* 톤: 배경 / 강조 */
.tone-violet { --tbg: #efedfb; --tfg: #5a4cc0; }
.tone-blue   { --tbg: #eaf1fd; --tfg: #2f63c4; }
.tone-green  { --tbg: #e9f5ec; --tfg: #2f8a4c; }
.tone-rose   { --tbg: #fbecef; --tfg: #b5405a; }
.tone-orange { --tbg: #fdf0e6; --tfg: #c0602a; }
.tone-teal   { --tbg: #e6f4f3; --tfg: #1f8079; }
.tone-amber  { --tbg: #fdf5e3; --tfg: #a8741a; }
.tone-indigo { --tbg: #ecedfa; --tfg: #3d47a8; }
.tone-red    { --tbg: #fdeeec; --tfg: #c23a2e; }
.tone-plain  { --tbg: #ffffff; --tfg: #3d47a8; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

.ic { width: 22px; height: 22px; flex: none; }
.muted { color: var(--ink-3); }

/* 한자·한글 표기: 한자는 조금 크고 진하게, 한글 독음은 작고 옅게 */
.hz { font-weight: 700; letter-spacing: .02em; }
.ko { font-size: .86em; color: var(--ink-2); font-weight: 500; margin-left: 2px; }
.hz-big { font-family: var(--serif); font-weight: 700; font-size: 1em; }
.ko-only { font-weight: 700; }

/* ── 레이아웃 ── */
.app { min-height: 100dvh; }
.sidebar { display: none; }
.view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.page { padding: 12px var(--gutter) 0; max-width: 1080px; margin: 0 auto; }
.page-title { font-size: 24px; font-weight: 800; margin: 16px 0 14px; }

/* ── 탭바 (모바일) ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--ink-3); font-weight: 600;
}
.tabbar a.on { color: var(--primary); }
.tabbar .ic { width: 24px; height: 24px; }

/* ── 홈 히어로 ── */
.hero {
  position: relative; overflow: hidden;
  padding: 28px var(--gutter) 20px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
.mountains {
  position: absolute; right: 0; top: 0; width: 70%; max-width: 520px; height: 150px; color: #51607f; opacity: .7; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%); mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}
/* 홈 히어로 배경 장식 (별자리·궤도) — 아래로 갈수록 사라져 카드 영역을 침범하지 않는다 */
.sky {
  position: absolute; right: 0; top: 0; width: 40%; max-width: 560px; height: 126px;
  opacity: .92; pointer-events: none;
  /* 왼쪽(제목 쪽)과 아래(카드 쪽)로 부드럽게 사라지게 해서 본문을 덮지 않는다 */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%), linear-gradient(to bottom, #000 40%, transparent 86%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 40%), linear-gradient(to bottom, #000 40%, transparent 86%);
  mask-composite: intersect;
}

.brand { position: relative; display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.brand .ic { width: 34px; height: 34px; color: var(--primary); }
.tagline { position: relative; color: var(--ink-2); font-size: 14.5px; margin: 6px 0 18px 2px; }

.searchbox {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 8px 0 16px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  box-shadow: 0 2px 10px rgba(30,40,80,.05);
}
.searchbox:focus-within { border-color: var(--primary); }
.searchbox > .ic { color: var(--ink-3); }
.searchbox input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 17px; color: var(--ink);
}
.searchbox input::placeholder { color: var(--ink-3); }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox .clear { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-3); border-radius: 50%; }

.results { padding: 4px var(--gutter) 0; max-width: 1080px; margin: 0 auto; }
.page .results { padding: 14px 0 0; }
.home-body { padding: 4px var(--gutter) 0; max-width: 1080px; margin: 0 auto; }

/* ── 카테고리 카드 ── */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 118px; padding: 14px 8px; border-radius: var(--radius);
  background: var(--tbg); color: var(--ink);
  transition: transform .08s;
}
.cat:active { transform: scale(.98); }
.cat-ic { width: 30px; height: 30px; color: var(--tfg); margin-bottom: 6px; }
.cat-name { font-size: 18px; font-weight: 800; line-height: 1.25; }
.cat-ko { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.cat-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* ── 블록 / 리스트 ── */
.block { margin-top: 26px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block-head h2 { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 800; }
.block-head h2 .ic { width: 20px; height: 20px; color: #e3a008; }
.more { font-size: 14px; color: var(--primary); font-weight: 600; padding: 8px 4px; }

.list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.list.flush { border: 0; border-radius: 0; background: transparent; }
.row { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); }
.list > .row:first-child, .list > .row-wrap:first-child .row { border-top: 0; }
.row:active { background: #f3f4f9; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; line-height: 1.35; }
.row-sub { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 18px; height: 18px; color: var(--ink-3); }
.row-wrap { position: relative; display: flex; align-items: center; border-top: 1px solid var(--line); }
.row-wrap:first-child { border-top: 0; }
.row-wrap .row { flex: 1; border-top: 0; }
.row-wrap .remove { margin-right: 6px; color: var(--ink-3); }

.pill {
  display: inline-flex; align-items: center; flex: none;
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--tbg, var(--primary-soft)); color: var(--tfg, var(--primary));
}
.pill-stub { background: #f0f0f4; color: var(--ink-3); }

.tags, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 6px 13px;
  background: var(--primary-soft); color: var(--ink); border-radius: 999px; font-size: 15px;
}
.tag .ko { font-size: .85em; }
.tag-off { background: #f1f1f4; color: var(--ink-3); }
.chip { display: inline-block; padding: 6px 12px; border-radius: 10px; background: rgba(255,255,255,.75); font-size: 15px; font-weight: 600; }

.empty { text-align: center; color: var(--ink-2); padding: 36px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty.small { padding: 18px 16px; font-size: 14px; }

.banner {
  display: flex; align-items: center; gap: 8px; margin: 12px 0;
  padding: 10px 14px; border-radius: 12px; background: #fff7df; color: #8a6414; font-size: 14px; font-weight: 600;
}
.banner .ic { width: 18px; height: 18px; }

/* ── 서브 헤더 ── */
.subhead {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 6px;
  background: rgba(246,246,250,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.subhead-title { flex: 1; text-align: center; font-size: 15px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subhead-actions { min-width: 44px; display: flex; justify-content: flex-end; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
.iconbtn:active { background: #eceef5; }
.fav.on { color: var(--primary); }
.fav.on .ic { fill: currentColor; }

/* ── 카테고리 헤더 ── */
.cat-head { display: flex; align-items: center; gap: 14px; padding: 18px; margin: 4px 0 14px; border-radius: var(--radius); background: var(--tbg); }
.cat-head .cat-ic { margin: 0; width: 36px; height: 36px; }
.cat-head h1 { font-size: 22px; font-weight: 800; }
.cat-head p { font-size: 14px; color: var(--ink-2); }

/* ── 상세 ── */
.term-head { position: relative; overflow: hidden; padding: 14px 2px 6px; }
.term-head .mountains { width: 60%; opacity: .9; }
.term-title { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.term-title h1 { font-size: 36px; line-height: 1.2; }
.term-title h1 .ko { font-size: 20px; }
.term-sub { position: relative; margin-top: 6px; color: var(--ink-2); font-size: 15.5px; }
.linkish { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 600; min-height: 44px; }
.linkish .ic { width: 18px; height: 18px; }

.cards { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.card { background: var(--tbg); border-radius: var(--radius); padding: 14px 16px 16px; break-inside: avoid; }
.tone-plain.card { border: 1px solid var(--line); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 800; color: var(--tfg); margin-bottom: 6px; }
.card-title .ic { width: 22px; height: 22px; }
.src {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.8); color: var(--ink-3);
}
.card-body { font-size: 16px; color: var(--ink); }
.card-body p + p { margin-top: 8px; }
.lead { font-size: 17px; font-weight: 600; }
.bullets { margin: 0; padding-left: 1.1em; }
.bullets li + li { margin-top: 4px; }
blockquote { margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid color-mix(in srgb, var(--tfg) 45%, transparent); }
.subnote { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.7); }
.subnote .src { margin: 0 0 4px; display: inline-block; }

/* 「四化(사화)를 만나면」 — 카드 안의 조합 블록 (기존 .subnote와 같은 방식) */
.combo { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.7); scroll-margin-top: 72px; }
.combo:first-child { margin-top: 2px; }
.combo-name { font-size: 15.5px; font-weight: 800; color: var(--tfg); margin: 0 0 6px; }
.combo.is-focus { background: #fff; box-shadow: 0 0 0 2px var(--tfg); }

.sf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sf-cell { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.8); font-size: 16px; min-height: 60px; }
.sf-self { outline: 2px solid var(--tfg); }
.sf-role { font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin-right: 6px; }

.chart-hit { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.chart-hit-main { flex: 1; }
.chart-hit + .tags { margin-top: 6px; }
.ok { display: inline-grid; vertical-align: -5px; margin-right: 4px; color: #2f8a4c; }
.ok .ic { width: 20px; height: 20px; }
.hit-detail { font-size: 14px; color: var(--ink-2); margin-top: 2px; }

.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.05); }
.kv:first-child { border-top: 0; }
.kv .k { font-size: 14px; font-weight: 700; color: var(--ink-2); padding-top: 8px; }
.kv .v .muted { padding-top: 8px; display: inline-block; }

.hua { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 2px; border-radius: 5px; font-size: 11px; font-weight: 800; color: #fff; vertical-align: 1px; font-family: var(--sans); }
.hua-祿 { background: #2f8a4c; }
.hua-權 { background: #5a4cc0; }
.hua-科 { background: #2f63c4; }
.hua-忌 { background: #c23a2e; }

/* ── 명반 판 ── */
.board {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, minmax(96px, auto));
  gap: 4px; margin-top: 8px;
}
.cell {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 6px 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0;
}
.cell:active { background: #f1f3fb; }
.cell-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; }
.cell-name { font-weight: 800; color: var(--primary); }
.cell-branch { color: var(--ink-3); font-weight: 700; }
.cell-major { display: flex; flex-direction: column; font-size: 15px; font-weight: 800; line-height: 1.3; }
.cell-minor { display: flex; flex-wrap: wrap; gap: 0 5px; font-size: 11.5px; color: var(--ink-2); line-height: 1.4; margin-top: auto; }
.cell-empty { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.cell .hua { width: 15px; height: 15px; font-size: 10px; border-radius: 4px; }
.board-center {
  grid-row: 2 / 4; grid-column: 2 / 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 10px; border-radius: 12px; background: var(--primary-soft);
}
.bc-title { font-size: 16px; font-weight: 800; }
.bc-summary { font-size: 13px; }
.bc-hint { font-size: 12px; }

/* ── 데스크톱 ── */
@media (min-width: 600px) {
  .cats { grid-template-columns: repeat(3, 1fr); }
  .term-title h1 { font-size: 44px; }
  .board { grid-template-rows: repeat(4, minmax(118px, auto)); gap: 6px; }
  .cell { padding: 8px 10px; }
  .cell-top { font-size: 13px; }
  .cell-major { font-size: 18px; }
  .cell-minor { font-size: 13px; }
}

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 232px 1fr; }
  .tabbar { display: none; }
  .view { padding-bottom: 48px; min-width: 0; }
  .sidebar {
    display: block; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 20px 12px; background: #f0f1f7; border-right: 1px solid var(--line);
  }
  .side-brand { display: flex; align-items: center; gap: 8px; padding: 4px 10px 18px; font-weight: 800; font-size: 16px; }
  .side-brand .ic { color: var(--primary); }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 15px; color: var(--ink-2); font-weight: 600; }
  .side-link .ic { width: 19px; height: 19px; color: var(--ink-3); }
  .side-link:hover { background: #e6e8f2; }
  .side-link.active { background: #e0e5f7; color: var(--primary); }
  .side-link.active .ic { color: var(--primary); }
  .side-link.small { font-size: 14px; padding: 7px 10px; }
  .side-link.sub { font-size: 13.5px; padding: 6px 10px 6px 39px; font-weight: 500; }
  .side-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fav-ic { color: #e3a008 !important; fill: #e3a008; }
  .side-sec { margin: 20px 10px 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
  .side-empty { padding: 4px 10px; font-size: 13px; color: var(--ink-3); }

  .hero { padding: 40px 40px 24px; }
  .sky { width: 56%; height: 240px; opacity: .95; }
  .hero .searchbox { max-width: 620px; }
  .home-body, .results { padding-left: 40px; padding-right: 40px; }
  .page { padding: 16px 40px 0; }
  .brand { font-size: 32px; }
  .m-only { display: none; }
  .cats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .cat { min-height: 132px; }
  .subhead { padding: 0 28px; background: rgba(246,246,250,.94); }
  .subhead-title { text-align: left; }
  .cards { display: block; columns: 2; column-gap: 12px; }
  .cards > .card { margin-bottom: 12px; display: inline-block; width: 100%; }
  .board { max-width: 760px; }
}

/* ── 2차: 중요도·상태값·협·조합 ── */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.imp { background: #eef0f6; color: var(--ink-2); }
.imp-core { background: #1f2f6e; color: #fff; }
.imp-major { background: #dfe6fb; color: #2f4a9e; }
.imp-minor { background: #eef0f6; color: var(--ink-2); }
.imp-nosolo { background: #fde3e0; color: #b3261e; }
.nosolo { font-weight: 700; color: #b3261e; margin-bottom: 6px; }
.st { font-size: .8em; font-weight: 800; color: #6b4fc0; margin-left: 3px; }
.tag-combo { background: #fdf0e6; }
.stub-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: #f1f1f5; color: var(--ink-2); font-size: 14px; }
.stub-note .ic { width: 18px; height: 18px; }
.linkish.sm { min-height: 0; font-size: 15px; }
.kv .v:not(.tags) { padding-top: 6px; }
.row-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--tbg); color: var(--tfg); }
.count { font-size: 14px; font-weight: 700; white-space: nowrap; }
.count .muted { font-weight: 500; font-size: 12.5px; }

.clamp { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 12px 6px; margin: 4px 0 6px; border-radius: 12px; background: rgba(255,255,255,.75); }
.clamp-star { display: inline-flex; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1.5px solid var(--tfg); font-size: 16px; }
.clamp-mid { padding: 8px 12px; border-radius: 10px; background: var(--tfg); color: #fff; font-weight: 700; font-size: 15px; }
.clamp-dash { color: var(--ink-3); }

.st-ko { font-weight: 600; }
.banner-list { align-items: flex-start; }
.banner-list .ic { margin-top: 3px; }
.banner-list ul { margin: 4px 0 0; padding-left: 1.1em; font-weight: 500; }
.inline-link { color: var(--primary); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(47,74,158,.3); text-underline-offset: 3px; }
.sf-text p { font-size: 17px; line-height: 1.9; }
.title-link { text-decoration: underline; text-decoration-color: rgba(47,74,158,.25); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.cat-title { margin: 8px 2px 16px; }
.cat-title h1 { font-size: 24px; font-weight: 800; line-height: 1.3; }
.cat-title h1 .ko { font-size: 17px; }
.cat-title p { margin-top: 8px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 10px; }
/* 분류를 누르면 바로 열리는 학습 페이지(간명 순서): 데스크톱에서 한 줄이 너무 길어지지 않게 */
.stack-read { max-width: 760px; }
/* 흐름형 카드(간명 순서): 단계 표시 · 핵심 질문 · 흐름 · 질문 목록 */
.card-title.has-step { flex-direction: column; align-items: flex-start; gap: 6px; }
.step { flex: none; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #fff; color: var(--tfg); }
.ask { margin-bottom: 10px; }
.ask .src { margin: 0 0 4px; display: inline-block; }
.flow { list-style: none; margin: 4px 0 10px; padding: 0; }
.flow li { font-weight: 700; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.75); }
.flow li + li { margin-top: 22px; position: relative; }
.flow li + li::before { content: '↓'; position: absolute; left: 50%; top: -20px; transform: translateX(-50%); color: var(--tfg); font-weight: 800; }
.flow-label { margin: 6px 0 4px; display: inline-block; }
.flow-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 10px; }
.flow-inline .fi { font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.75); }
.flow-inline .fa { color: var(--tfg); font-weight: 800; }
.asks .ask-row { display: grid; grid-template-columns: minmax(0, 11em) 1fr; gap: 4px 12px; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); }
.asks .ask-row:first-child { border-top: 0; padding-top: 2px; }
.ask-k { font-size: 14px; font-weight: 700; color: var(--tfg); }
.ask-v { font-weight: 600; }
@media (max-width: 480px) { .asks .ask-row { grid-template-columns: 1fr; } }
.card-plain { background: var(--surface); border: 1px solid var(--line); }
.table-block { margin: 6px 0 18px; padding: 16px; border-radius: var(--radius); }
.table-block.primary { background: #eef2fd; border: 2px solid #2f4a9e; }
.table-block.comparison { background: #f4f4f7; border: 1.5px dashed #b9bccb; }
.tb-head h2 { font-size: 18px; font-weight: 800; margin-top: 8px; line-height: 1.4; }
.tb-sub { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.tb-intro { margin: 10px 0; font-size: 15.5px; }
.tb-intro p + p { margin-top: 8px; }
.tb-legend { font-size: 13px; color: var(--ink-2); margin: 8px 0 10px; }
.tb-notice { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: #fff; color: var(--ink-2); font-size: 14.5px; }
.tb-notice .ic { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }
.badge-primary { background: #2f4a9e; color: #fff; }
.badge-compare { background: #fff; color: var(--ink-2); border: 1px solid #b9bccb; }
.stem-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.stem-block { background: #fff; border-radius: 12px; padding: 10px 12px; }
.comparison .stem-block { background: #fbfbfc; }
.stem-head { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
.stem-item { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 4px 0; font-size: 15.5px; }
.stem-item a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(47,74,158,.25); text-underline-offset: 3px; }
.stem-item.differs { background: #fff4d6; margin: 2px -6px; padding: 4px 6px; border-radius: 8px; }
.diff-tag { font-size: 11.5px; font-weight: 700; color: #8a6414; background: #fde7a8; padding: 1px 7px; border-radius: 999px; }
@media (min-width: 600px) { .stem-grid { grid-template-columns: 1fr 1fr; } }
.kind-pill { vertical-align: 4px; margin-left: 6px; font-size: 12px; }
/* 학습용 배지: 제목보다 약하게 (六吉星 포함 · 六煞星 · 吉星) */
.title-badge { vertical-align: 5px; margin-left: 8px; font-size: 11.5px; font-weight: 700; }
.star-badge { margin-left: 6px; padding: 1px 7px; font-size: 11px; vertical-align: 2px; }
/* 별 계열색: 목록의 별 이름·상세 큰 제목의 한자만 (본문·관련 용어는 그대로) */
.fam-major .hz { color: #4f3fb3; }
.fam-assist .hz { color: #1f5fbf; }
.fam-sha .hz { color: #a8322a; }
.fam-minor .hz { color: var(--ink); }
.chk { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 2px; border-radius: 50%; background: #f5c451; color: #5a3d00; font-size: 10px; font-weight: 800; vertical-align: 2px; font-family: var(--sans); }
.clamp-note { font-size: 13px; text-align: center; margin-bottom: 6px; }
.tag-group { background: #e6f4f3; }
.sub-title { font-size: 15px; font-weight: 800; color: var(--ink-2); margin: 18px 4px 8px; }
.sub-title:first-of-type { margin-top: 4px; }
.intro { margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15.5px; }
.intro p + p { margin-top: 10px; }
.cls-note p + p { margin-top: 6px; }
.kv .v.chips { padding-top: 2px; }
.body-mark { margin-left: 3px; font-size: 10px; padding: 0 3px; border-radius: 3px; background: var(--primary); color: #fff; }
.cell-daxian { font-size: 11px; color: var(--ink-3); }

@media (hover: hover) {
  .row:hover, .cell:hover { background: #f5f6fb; }
  .tag:hover { filter: brightness(.97); }
}
