/*
  똑부러지는 임직원의 슬기로운 보안생활 - 공통 스타일
  기본 틀: 토스 가이드(toss-light.md)의 색·간격·모서리·글자 위계
  구성: 시안 1(Win + L 첫 화면) + 시안 3(분류로 걸러 보는 글 모아보기) + 시안 2(눌러 보는 메일 체험)
*/
:root {
  --bg: #FFFFFF;
  --surface: #F2F4F6;
  --line: #E5E8EB;
  --line-strong: #B0B8C1;
  --fg: #191F28;
  --fg2: #4E5968;
  --fg3: #6B7684;
  --accent: #3182F6;
  --accent-soft: #E8F3FF;
  --accent-ink: #1B64DA;
  --on-accent: #FFFFFF;
  --danger-bg: #FFEEEE;
  --danger-fg: #D22030;
  --danger-solid: #D22030;
  --done-bg: #F0FAF6;
  --done-fg: #029359;
  --key-face: #FFFFFF;
  --key-edge: #D1D6DB;
  --key-shadow: rgba(0, 23, 51, .12);

  --font: 'Noto Sans KR', 'Toss Product Sans', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', sans-serif;

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-scene: 40px;
  --space-section: 88px;
  --container-max: 1184px;
  --container-gutter: 24px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171C; --surface: #202027; --line: #3C3C47; --line-strong: #5A5A66;
    --fg: #FFFFFF; --fg2: #C9C9CE; --fg3: #9E9EA4;
    --accent: #3485FA; --accent-soft: #1C2B47; --accent-ink: #78B0FF;
    --danger-bg: #3A1F24; --danger-fg: #FF8A93; --danger-solid: #D22030;
    --done-bg: #14301F; --done-fg: #4ADE9B;
    --key-face: #30303A; --key-edge: #101014; --key-shadow: rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
@media (max-width: 640px) {
  :root { --container-gutter: 20px; --space-section: 64px; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 17px; line-height: 1.6; letter-spacing: -.02em; word-break: keep-all;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.container { width: min(calc(100% - var(--container-gutter) * 2), var(--container-max)); margin-inline: auto; }
.section { padding-top: var(--space-section); }
.ok { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: inline-grid; place-items: center; }
.ok svg { width: 16px; height: 16px; }

/* ---------- 머리말 ---------- */
.site-head { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-name { font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -.04em; }
.name-short { display: none; }
.site-nav { display: flex; gap: 24px; flex: none; }
.site-nav a { padding: 8px 0; font-size: 15px; font-weight: 500; color: var(--fg2); }
.site-nav a:hover { color: var(--fg); }
.site-nav a[aria-current="page"] { color: var(--fg); font-weight: 700; }
@media (max-width: 640px) {
  .site-head { height: 56px; }
  .name-full { display: none; }
  .name-short { display: inline; }
  .site-nav { gap: 18px; }
}

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: var(--r-lg); border: 0; font: 600 16px/1.4 var(--font); letter-spacing: -.02em; cursor: pointer; transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: #2272EB; }
.btn--primary:active { background: #1B64DA; }
.btn--weak { background: var(--accent-soft); color: var(--accent-ink); }
.btn--weak:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent)); }
.btn--ghost { background: transparent; color: var(--fg2); }
.btn--ghost:hover { background: var(--surface); }
.btn[disabled] { opacity: .4; cursor: default; pointer-events: none; }

/* ---------- 첫 화면: Win + L ---------- */
.hero { border-radius: var(--r-scene); background: var(--surface); padding: 64px 56px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero-title { font-size: clamp(38px, 5.6vw, 66px); line-height: 1.2; font-weight: 700; letter-spacing: -.05em; text-wrap: balance; }
.hero-title--md { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.25; }
.hero-title--sm { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.3; }
.hero-copy > p { margin-top: 20px; font-size: 18px; line-height: 1.7; color: var(--fg2); max-width: 21em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hero-art { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.keys { display: flex; align-items: center; gap: 16px; }
.plus { font-size: 28px; font-weight: 500; color: var(--fg3); }
.key {
  width: clamp(84px, 13vw, 132px); aspect-ratio: 1; border-radius: var(--r-xl); background: var(--key-face); color: var(--fg);
  display: grid; place-items: center; font-size: clamp(30px, 4.6vw, 52px); font-weight: 900; letter-spacing: -.04em;
  box-shadow: 0 8px 0 var(--key-edge), 0 24px 40px var(--key-shadow); margin-bottom: 8px;
  animation: key-press .9s .5s var(--ease) 1 both;
}
.key--l { animation-delay: .62s; }
@keyframes key-press {
  0% { transform: none; }
  35% { transform: translateY(8px); box-shadow: 0 0 0 var(--key-edge), 0 8px 16px var(--key-shadow); }
  100% { transform: none; }
}
/* 첫 화면 그림 (templates/hero/*.html). 선·면 색은 테마 값을 따름 */
.art-card { width: clamp(148px, 20vw, 210px); aspect-ratio: 1; padding: 22px; border-radius: var(--r-xl); background: var(--key-face); box-shadow: 0 8px 0 var(--key-edge), 0 24px 40px var(--key-shadow); margin-bottom: 8px; animation: key-press .9s .5s var(--ease) 1 both; }
.art-svg { display: block; width: 100%; height: 100%; }
.ic-line { stroke: var(--fg); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.ic-acc { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.ic-fill-acc { fill: var(--accent); stroke: none; }
.ic-fill-line { fill: var(--fg); stroke: none; }
.ic-danger { fill: var(--danger-solid); stroke: none; }
.ic-white { stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.ic-white-fill { fill: #fff; stroke: none; }
.lock-chip { display: inline-flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 18px 12px 14px; font-size: 16px; font-weight: 600; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 44px 28px; gap: 36px; border-radius: 32px; }
}
@media (max-width: 640px) {
  .hero { padding: 36px 22px 40px; }
  .hero-copy > p { font-size: 17px; }
}

/* ---------- 구획 제목 ---------- */
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 40px; margin-bottom: 28px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.3; font-weight: 700; letter-spacing: -.05em; text-wrap: balance; }
.sec-head p { color: var(--fg2); max-width: 24em; font-size: 16px; line-height: 1.7; }

/* ---------- 글 모아보기 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip-btn { min-height: 40px; padding: 8px 16px; border: 0; border-radius: var(--r-md); background: var(--surface); color: var(--fg2); font: 600 15px/1.4 var(--font); letter-spacing: -.02em; cursor: pointer; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.chip-btn:hover { background: var(--line); }
.chip-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.posts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 200px; padding: 28px; border-radius: var(--r-xl); background: var(--surface); transition: transform var(--dur-base) var(--ease); }
.post-card:hover { transform: translateY(-2px); }
.post-card:active { transform: scale(.99); }
.post-card h3 { font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
.post-card p { color: var(--fg2); font-size: 15px; line-height: 1.7; max-width: 32em; }
.post-card .post-meta { margin-top: auto; }
.badge { display: inline-flex; width: max-content; padding: 3px 8px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--fg2); font-size: 13px; font-weight: 600; }
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg3); }
.tag { font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.empty { grid-column: 1 / -1; padding: 32px; border-radius: var(--r-xl); background: var(--surface); color: var(--fg2); }
@media (max-width: 760px) {
  .posts { grid-template-columns: 1fr; }
  .post-card { min-height: 0; padding: 24px; }
}

/* 체험실 안내 */
.lab-teaser { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; padding: 44px 48px; border-radius: 32px; background: var(--accent-soft); }
.lab-teaser h2 { font-size: clamp(26px, 3.2vw, 33px); line-height: 1.35; font-weight: 700; letter-spacing: -.045em; }
.lab-teaser p { margin-top: 12px; color: var(--fg2); font-size: 16px; max-width: 28em; }
@media (max-width: 640px) { .lab-teaser { padding: 32px 24px; border-radius: 28px; } }

/* ---------- 체험: 의심 메일 ---------- */
.exp { margin-top: 1.6em; display: grid; gap: 12px; }
.exp-h { font-size: 14px; font-weight: 500; color: var(--fg3); }
.mail { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: 0 8px 24px rgba(0, 23, 51, .08); }
.mail-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.7; align-items: baseline; }
.mail-row dt { color: var(--fg3); font-size: 13px; }
.mail-row dd { min-width: 0; overflow-wrap: anywhere; }
.mail-body { padding: 20px 24px 24px; font-size: 16px; line-height: 1.9; color: var(--fg2); }
.hs { font: inherit; letter-spacing: inherit; color: inherit; text-align: inherit; cursor: pointer; background: transparent; border: 0; border-radius: var(--r-sm); padding: 2px 6px; margin: -2px -6px; text-decoration: underline dotted var(--fg3); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.hs:hover { background: var(--surface); }
.hs[aria-pressed="true"] { background: var(--danger-bg); color: var(--danger-fg); text-decoration: none; }
.hs-tag { display: none; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--danger-solid); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 1px; }
.hs[aria-pressed="true"] .hs-tag { display: inline-block; }
.mail-foot { background: var(--surface); padding: 20px 24px; display: grid; gap: 16px; }
.finds { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 15px; line-height: 1.7; color: var(--fg2); }
.finds li { padding-left: 14px; position: relative; }
.finds li::before { content: ""; position: absolute; left: 0; top: .75em; width: 6px; height: 6px; border-radius: 50%; background: var(--danger-solid); }
.finds .none { padding-left: 0; color: var(--fg3); }
.finds .none::before { display: none; }
.exp-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.exp-count { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.report-btn { background: var(--accent); color: var(--on-accent); }
.report-btn[data-done="true"] { background: var(--done-bg); color: var(--done-fg); opacity: 1; }
.exp-note { font-size: 13px; color: var(--fg3); line-height: 1.5; }
.post-body .finds li { padding: 0 0 0 14px; background: none; border-radius: 0; font-size: 15px; line-height: 1.7; }
.post-body .finds li.none { padding-left: 0; }
@media (max-width: 560px) {
  .mail-row { grid-template-columns: 1fr; gap: 2px; padding: 12px 18px; }
  .mail-body, .mail-foot { padding-inline: 18px; }
}

/* 체험실 화면 */
.lab { padding-top: 56px; display: grid; gap: 48px; }
.lab-head { display: grid; gap: 12px; max-width: 34em; }
.lab-head h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.25; font-weight: 700; letter-spacing: -.05em; }
.lab-head p { color: var(--fg2); font-size: 17px; line-height: 1.7; }
.lab-list { display: grid; gap: 40px; max-width: 720px; }
.lab-item { display: grid; gap: 16px; justify-items: start; padding: 32px; border-radius: var(--r-xl); background: var(--surface); }
.lab-item h2 { font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: -.04em; }
.lab-item .exp { margin-top: 0; width: 100%; }
.lab-body { display: grid; gap: 16px; width: 100%; }
.lab-body > p { color: var(--fg2); font-size: 16px; line-height: 1.7; }
@media (max-width: 640px) { .lab-item { padding: 24px 16px; } }

/* ---------- 점검 카드 (본문에서 씀) ---------- */
.check-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 24px; display: grid; gap: 10px; }
.check-h { font-size: 14px; font-weight: 500; color: var(--fg3); margin-bottom: 4px; }
.check-q { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: var(--surface); color: var(--fg); padding: 16px; border-radius: var(--r-lg); font: 500 17px/1.5 var(--font); letter-spacing: -.02em; cursor: pointer; transition: transform var(--dur-fast) var(--ease); }
.check-q:active { transform: scale(.99); }
.check-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.check-mark svg { width: 16px; height: 16px; opacity: 0; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: opacity var(--dur-fast) var(--ease); }
.check-q[aria-pressed="true"] .check-mark { background: var(--accent); border-color: var(--accent); }
.check-q[aria-pressed="true"] .check-mark svg { opacity: 1; }
.check-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); transition: background-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease); }
.check-verdict[data-pass="true"] { background: var(--accent); color: var(--on-accent); }
.cv-count { font-size: 14px; color: var(--fg3); font-variant-numeric: tabular-nums; }
.cv-v { font-size: 20px; line-height: 1.4; font-weight: 700; letter-spacing: -.03em; }
.cv-rest { margin-left: auto; font-size: 14px; color: var(--fg3); }
.check-verdict[data-pass="true"] .cv-count, .check-verdict[data-pass="true"] .cv-rest { color: inherit; opacity: .9; }

/* ---------- 맺음 ---------- */
.site-foot { margin-top: var(--space-section); padding-bottom: 48px; }
.foot-in { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 40px; flex-wrap: wrap; color: var(--fg3); font-size: 13px; line-height: 1.7; }
.foot-in .site-name { color: var(--fg); font-size: 15px; }
.foot-in p { max-width: 38em; }

/* ---------- 본문 화면 ---------- */
.prose { width: min(calc(100% - var(--container-gutter) * 2), 700px); margin-inline: auto; }
.post-head { padding-top: 56px; display: grid; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; width: max-content; font-size: 14px; color: var(--fg3); }
.back:hover { color: var(--fg); }
.post-head h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.28; font-weight: 700; letter-spacing: -.05em; text-wrap: balance; }
.post-sub { font-size: 19px; line-height: 1.6; color: var(--fg2); }
.post-body { margin-top: 48px; font-size: 18px; line-height: 1.9; }
.post-body > * + * { margin-top: 1.4em; }
.post-body > h2 { margin-top: 2.8em; font-size: 26px; line-height: 1.4; font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
.post-body > h2 + * { margin-top: .9em; }
.post-body strong { font-weight: 700; }
.post-body blockquote { margin-inline: 0; padding: 18px 22px; border-radius: var(--r-lg); background: var(--surface); color: var(--fg2); font-size: 15px; line-height: 1.75; }
.post-body blockquote > * + * { margin-top: .8em; }
.post-body ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.post-body ul li { padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface); font-size: 17px; line-height: 1.7; }
.post-body li strong { margin-right: 6px; color: var(--accent-ink); }
.post-body ol { padding-left: 1.4em; display: grid; gap: .6em; }
.post-body a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--r-lg); }
.post-body code { padding: 2px 6px; border-radius: var(--r-sm); background: var(--surface); font-size: .9em; }
.post-body pre { overflow-x: auto; padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface); font-size: 15px; line-height: 1.6; }
.post-body pre code { padding: 0; background: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.table-wrap table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: 13px 18px; text-align: right; border-bottom: 1px solid var(--line); }
.table-wrap th:first-child, .table-wrap td:first-child { text-align: left; color: var(--fg2); }
.table-wrap thead th { background: var(--surface); font-weight: 700; color: var(--fg); }
.table-wrap tbody tr:last-child th, .table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody th { font-weight: 400; }
.post-body .table-wrap + p { margin-top: .6em; font-size: 14px; line-height: 1.6; color: var(--fg3); }
.post-body .check-card { margin-top: 1.6em; }
.post-end { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); display: grid; gap: 28px; }
.end-mark { display: flex; align-items: center; gap: 14px; color: var(--fg3); font-size: 15px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.next { display: grid; gap: 10px; align-content: start; padding: 24px 28px; border-radius: var(--r-xl); background: var(--surface); transition: transform var(--dur-base) var(--ease); }
.next:hover { transform: translateY(-2px); }
.next--newer { grid-column: 2; }
.next h2 { font-size: 20px; line-height: 1.4; font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
.next p { color: var(--fg2); font-size: 15px; }
.next .badge { background: var(--bg); border-color: transparent; }
.post-end .btn { width: max-content; }
@media (max-width: 760px) {
  .post-nav { grid-template-columns: 1fr; }
  .next--newer { grid-column: auto; }
  .check-card { padding: 20px; }
}
@media (max-width: 640px) {
  .post-head { padding-top: 36px; }
  .post-sub { font-size: 17px; }
  .post-body { font-size: 17px; margin-top: 36px; }
  .post-body > h2 { font-size: 23px; }
  .lab { padding-top: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .key, .art-card { animation: none; }
  .btn, .chip-btn, .post-card, .next, .check-q, .check-mark, .check-mark svg, .check-verdict { transition: none; }
  .btn:active, .post-card:hover, .post-card:active, .next:hover, .check-q:active { transform: none; }
}
