/* ===== 질병코드 실비정보 - Design System ===== */
/* Palette: Clinical Trust */
/* --navy: #1a2744  --teal: #1e6b6b  --mint: #d4ede8 */
/* --amber: #e8930a  --sand: #f7f5f0  --white: #ffffff */
/* --text: #1c1c1e  --muted: #5a6273  --border: #d8dce5 */

:root {
  --navy: #1a2744;
  --teal: #1e6b6b;
  --teal-light: #2a8a8a;
  --mint: #d4ede8;
  --mint-pale: #eef7f5;
  --amber: #e8930a;
  --amber-pale: #fdf3e0;
  --sand: #f7f5f0;
  --white: #ffffff;
  --text: #1c1c1e;
  --muted: #5a6273;
  --border: #d8dce5;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 12px rgba(26,39,68,.08);
  --shadow-md: 0 4px 24px rgba(26,39,68,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Noto Sans KR', -apple-system, sans-serif;
  color: var(--text);
  background: var(--sand);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page-wrap { max-width: 780px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: 1100px; margin: 0 auto; padding: 0 20px;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--white);
}
.site-logo .logo-icon {
  width: 32px; height: 32px; background: var(--teal);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; color: white; letter-spacing: -1px;
}
.site-logo .logo-text { font-size: 15px; font-weight: 700; line-height: 1.2; }
.site-logo .logo-sub { font-size: 10px; color: rgba(255,255,255,.55); font-weight: 400; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: rgba(255,255,255,.75); text-decoration: none;
  font-size: 13px; padding: 6px 12px; border-radius: 6px;
  transition: all .2s;
}
.site-nav a:hover { color: white; background: rgba(255,255,255,.1); }

.nav-toggle { display: none; background: none; border: none; color: white; font-size: 22px; cursor: pointer; }

/* ===== HERO / SEARCH ===== */
.search-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  padding: 56px 20px 48px;
  text-align: center;
}
.search-hero h1 {
  color: white; font-size: clamp(24px, 4vw, 38px);
  font-weight: 800; letter-spacing: -0.5px; margin-bottom: 10px;
}
.search-hero .hero-sub {
  color: rgba(255,255,255,.72); font-size: 15px; margin-bottom: 32px;
}
.search-box {
  max-width: 640px; margin: 0 auto;
  display: flex; gap: 0; background: white;
  border-radius: 50px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.search-box input {
  flex: 1; border: none; outline: none; padding: 16px 24px;
  font-size: 16px; color: var(--text); background: transparent;
  font-family: inherit;
}
.search-box input::placeholder { color: #999; }
.search-btn {
  background: var(--teal); color: white; border: none;
  padding: 0 28px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s;
  font-family: inherit;
}
.search-btn:hover { background: var(--teal-light); }
.search-hint { margin-top: 14px; color: rgba(255,255,255,.55); font-size: 13px; }
.search-hint span { margin: 0 6px; cursor: pointer; text-decoration: underline; transition: color .2s; }
.search-hint span:hover { color: rgba(255,255,255,.9); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 12px 20px; font-size: 13px; color: var(--muted);
  max-width: 1100px; margin: 0 auto;
}
.breadcrumb a { color: var(--teal); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; color: var(--border); }

/* ===== ANSWER BOX ===== */
.answer-box {
  background: var(--mint-pale); border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px; margin-bottom: 32px;
}
.answer-box p { font-size: 15px; line-height: 1.8; margin-bottom: 8px; }
.answer-box p:last-child { margin-bottom: 0; }

/* ===== INFO TABLE ===== */
.info-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; font-size: 14px; }
.info-table th, .info-table td {
  padding: 12px 16px; border: 1px solid var(--border); text-align: left;
}
.info-table th { background: var(--navy); color: white; font-weight: 600; width: 30%; }
.info-table tr:nth-child(even) td { background: var(--sand); }

/* ===== SECTIONS ===== */
.content-section { margin-bottom: 48px; }
.content-section h2 {
  font-size: 20px; font-weight: 700; color: var(--navy);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--mint);
  letter-spacing: -0.3px;
}
.content-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.content-section p { font-size: 15px; line-height: 1.85; margin-bottom: 14px; color: #2a2a2e; }
.content-section ul, .content-section ol {
  padding-left: 20px; margin-bottom: 14px; font-size: 15px; line-height: 1.85;
}
.content-section li { margin-bottom: 6px; }

/* ===== INSURANCE BADGE ===== */
.insurance-possibility {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--amber-pale); border: 1px solid var(--amber);
  border-radius: var(--radius); padding: 10px 18px;
  font-size: 14px; font-weight: 600; color: #7a4e00; margin-bottom: 20px;
}
.insurance-possibility .badge-icon { font-size: 18px; }

/* ===== CHECKLIST ===== */
.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.checklist li:last-child { border-bottom: none; }
.checklist .check-icon {
  width: 22px; height: 22px; border: 2px solid var(--teal);
  border-radius: 4px; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal); font-size: 13px;
}

/* ===== DOCUMENTS ===== */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.doc-item {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; transition: box-shadow .2s;
}
.doc-item:hover { box-shadow: var(--shadow); }
.doc-item .doc-icon { font-size: 20px; }

/* ===== FAQ ===== */
.faq-list { }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq-q {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px; cursor: pointer; font-weight: 600; font-size: 15px;
  background: white; gap: 12px; transition: background .2s;
}
.faq-q:hover { background: var(--sand); }
.faq-q .q-mark { color: var(--teal); font-weight: 800; flex-shrink: 0; margin-right: 4px; }
.faq-q .faq-toggle { color: var(--muted); transition: transform .25s; font-size: 18px; flex-shrink: 0; }
.faq-item.open .faq-toggle { transform: rotate(180deg); }
.faq-a {
  display: none; padding: 14px 20px 18px 42px;
  background: var(--sand); font-size: 14px; line-height: 1.85; color: #2a2a2e;
}
.faq-item.open .faq-a { display: block; }

/* ===== RELATED CODES ===== */
.related-codes { display: flex; flex-wrap: wrap; gap: 10px; }
.code-chip {
  display: inline-block; text-decoration: none;
  background: white; border: 1px solid var(--border);
  border-radius: 20px; padding: 7px 16px;
  font-size: 13px; color: var(--text); transition: all .2s;
}
.code-chip:hover { background: var(--mint); border-color: var(--teal); color: var(--teal); }
.code-chip .chip-code { font-weight: 700; color: var(--teal); margin-right: 4px; }

/* ===== REFERENCES ===== */
.ref-list { list-style: none; padding: 0; }
.ref-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.ref-list li:last-child { border-bottom: none; }
.ref-list a { color: var(--teal); text-decoration: none; }
.ref-list a:hover { text-decoration: underline; }
.ref-badge { background: var(--navy); color: white; font-size: 10px; padding: 2px 7px; border-radius: 10px; }

/* ===== DISCLAIMER ===== */
.disclaimer-box {
  background: #f0f0f0; border: 1px solid #ccc;
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 13px; color: #555; line-height: 1.7;
  margin: 40px 0 20px;
}
.disclaimer-box strong { display: block; margin-bottom: 4px; color: #333; }

/* ===== META INFO ===== */
.meta-info { font-size: 13px; color: var(--muted); padding: 12px 0; border-top: 1px solid var(--border); margin-top: 8px; }

/* ===== POPULAR CODES ===== */
.popular-section { padding: 48px 0; }
.popular-section h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 24px; }
.code-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.code-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; text-decoration: none; color: var(--text);
  transition: all .2s; display: flex; flex-direction: column; gap: 6px;
}
.code-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal); transform: translateY(-2px); }
.code-card .card-code { font-size: 13px; font-weight: 700; color: var(--teal); font-family: monospace; }
.code-card .card-name { font-size: 15px; font-weight: 600; }
.code-card .card-dept { font-size: 12px; color: var(--muted); }
.code-card .card-arrow { margin-top: 8px; font-size: 12px; color: var(--teal); }

/* ===== CATEGORY GRID ===== */
.category-section { padding: 40px 0; background: var(--navy); }
.category-section h2 { color: white; font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cat-item {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 14px 16px;
  text-decoration: none; color: white; transition: all .2s;
  display: flex; flex-direction: column; gap: 3px;
}
.cat-item:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); }
.cat-item .cat-range { font-family: monospace; font-size: 12px; color: var(--mint); font-weight: 700; }
.cat-item .cat-name { font-size: 13px; line-height: 1.4; }

/* ===== GUIDE SECTION ===== */
.guide-section { padding: 48px 0; }
.guide-section h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 24px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.guide-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; text-decoration: none; color: var(--text); transition: all .2s;
}
.guide-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal); }
.guide-card .guide-icon { font-size: 28px; margin-bottom: 10px; }
.guide-card .guide-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.guide-card .guide-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ===== SEARCH RESULTS ===== */
.search-results { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: none; }
.search-results.show { display: block; }
.result-item {
  display: block; padding: 14px 20px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text); transition: background .15s;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--mint-pale); }
.result-item .r-code { font-family: monospace; font-weight: 700; color: var(--teal); font-size: 14px; }
.result-item .r-name { font-size: 15px; margin-left: 10px; }
.result-item .r-cat { font-size: 12px; color: var(--muted); margin-top: 3px; }
.result-empty { padding: 24px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ===== ARTICLE LAYOUT ===== */
.article-layout {
  display: grid; grid-template-columns: 1fr 280px; gap: 32px;
  max-width: 1100px; margin: 0 auto; padding: 32px 20px;
  align-items: start;
}
.article-main { min-width: 0; }
.article-sidebar { position: sticky; top: 80px; }
.sidebar-card {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
}
.sidebar-card h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 14px; }
.sidebar-links { list-style: none; }
.sidebar-links li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sidebar-links li:last-child { border-bottom: none; }
.sidebar-links a { color: var(--teal); text-decoration: none; }
.sidebar-links a:hover { text-decoration: underline; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy); color: rgba(255,255,255,.6);
  padding: 40px 20px; margin-top: 60px; font-size: 13px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 20px; }
.footer-links a { color: rgba(255,255,255,.7); text-decoration: none; }
.footer-links a:hover { color: white; }
.footer-disclaimer { line-height: 1.75; color: rgba(255,255,255,.45); }
.footer-copy { margin-top: 20px; }

/* ===== HIGHLIGHT MARKS ===== */
mark { background: rgba(30,107,107,.12); color: var(--teal); border-radius: 2px; padding: 0 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
}
@media (max-width: 640px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .site-nav.open {
    display: flex; flex-direction: column; position: absolute; top: 60px;
    left: 0; right: 0; background: var(--navy); padding: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .code-cards { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .search-box input { font-size: 14px; padding: 14px 16px; }
  .search-btn { padding: 0 18px; font-size: 14px; }
  .info-table th { width: 40%; }
}
@media (max-width: 400px) {
  .code-cards { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
}

/* ===== PRINT ===== */
@media print {
  .site-header, .site-footer, .article-sidebar, .search-hero { display: none; }
  .article-layout { display: block; }
}
