/* mddcalc.com 공용 스타일
   원래 14개 HTML 에 인라인으로 복제돼 있던 <style> 블록입니다.
   페이지마다 같은 15KB 를 다시 내려받게 되므로 파일 하나로 분리했습니다.
   index.html 은 홈 전용 스타일이 더해진 별도 버전을 인라인으로 갖고 있습니다. */

  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Malgun Gothic", sans-serif;
         background: linear-gradient(135deg, #f0f4f8 0%, #e8ecf1 100%); color: #1a202c; line-height: 1.5; padding: 16px; }
  .container { max-width: 1200px; margin: 0 auto; }
  h1 { font-size: 28px; margin-bottom: 6px; color: #2d3748; }
  .subtitle { color: #718096; margin-bottom: 20px; font-size: 14px; }

  .card { background: #fff; border-radius: 14px; padding: 20px; margin-bottom: 16px;
          box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

  .api-panel { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); color: white; }
  .api-panel h2 { font-size: 18px; margin-bottom: 12px; }
  .api-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
  .api-row label { font-size: 13px; min-width: 90px; font-weight: 600; }
  .api-row input { flex: 1; min-width: 180px; padding: 10px 12px; border: none; border-radius: 8px;
                   font-size: 14px; font-family: monospace; }
  .btn { padding: 10px 20px; background: #fff; color: #2d3748; border: none; border-radius: 8px;
         font-weight: 700; cursor: pointer; font-size: 14px; transition: all 0.2s; }
  .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
  .btn-primary { background: #2d3748; color: #fff; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .api-help { font-size: 12px; opacity: 0.95; margin-top: 8px; }
  .api-help a { color: #fff; text-decoration: underline; }
  .status { margin-top: 10px; padding: 12px 14px; border-radius: 6px; font-size: 13px;
            background: rgba(255,255,255,0.2); display: none; white-space: pre-wrap; line-height: 1.6; }
  .status.show { display: block; }
  .status.error { background: rgba(254, 178, 178, 0.9); color: #742a2a; }
  .status.success { background: rgba(198, 246, 213, 0.9); color: #22543d; }

  /* 관심종목 */
  .favorites-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .fav-chip { display: inline-flex; align-items: center; gap: 4px; background: #ebf8ff; color: #2b6cb0;
              border-radius: 20px; padding: 6px 6px 6px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
              transition: background 0.2s; }
  .fav-chip:hover { background: #bee3f8; }
  .fav-chip .fav-remove { background: none; border: none; color: #63b3ed; font-size: 15px; cursor: pointer;
                           padding: 2px 6px; line-height: 1; border-radius: 50%; }
  .fav-chip .fav-remove:hover { color: #e53e3e; background: rgba(255,255,255,0.6); }
  .fav-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: #cbd5e0; padding: 0 4px;
             line-height: 1; transition: color 0.2s, transform 0.15s; vertical-align: middle; }
  .fav-btn:hover { transform: scale(1.15); }
  .fav-btn.active { color: #f6ad55; }

  .controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
  .controls label { font-size: 13px; font-weight: 600; color: #4a5568; }
  .controls input[type=date] { padding: 6px 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 13px; }
  .preset-btn { padding: 6px 12px; background: #edf2f7; border: 1px solid #cbd5e0; border-radius: 6px;
                cursor: pointer; font-size: 12px; }
  .preset-btn.active { background: #4299e1; color: #fff; border-color: #4299e1; }
  .mode-toggle { display: inline-flex; background: #edf2f7; border-radius: 8px; padding: 3px; }
  .mode-toggle button { padding: 6px 14px; border: none; background: transparent; cursor: pointer;
                        border-radius: 6px; font-size: 13px; font-weight: 600; }
  .mode-toggle button.active { background: #4299e1; color: #fff; }

  .hero { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: center;
          text-align: center; padding: 24px 16px; }
  .hero-box h3 { font-size: 12px; color: #718096; font-weight: 600; margin-bottom: 6px; }
  .hero-box .big { font-size: 28px; font-weight: 800; color: #2d3748; }
  .hero-box .sub { font-size: 12px; color: #718096; margin-top: 4px; }
  .hero .arrow { font-size: 24px; color: #a0aec0; }
  .hero-dd { color: #e53e3e !important; }
  .hero-dd.mild { color: #d69e2e !important; }
  .hero-dd.small { color: #38a169 !important; }

  .signal-card { padding: 20px; border-radius: 12px; text-align: center; margin-top: 14px; }
  .signal-strong { background: #fed7d7; border: 2px solid #e53e3e; }
  .signal-mid { background: #fefcbf; border: 2px solid #d69e2e; }
  .signal-mild { background: #feebc8; border: 2px solid #dd6b20; }
  .signal-none { background: #e2e8f0; border: 2px solid #a0aec0; }
  .signal-emoji { font-size: 40px; margin-bottom: 6px; }
  .signal-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
  .signal-desc { font-size: 14px; color: #4a5568; }

  .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .stat-box { background: #f7fafc; padding: 14px; border-radius: 10px; text-align: center; border: 1px solid #e2e8f0; }
  .stat-box .label { font-size: 11px; color: #718096; margin-bottom: 4px; font-weight: 600; }
  .stat-box .value { font-size: 18px; font-weight: 700; color: #2d3748; }

  .target-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
  .target-box { padding: 12px; border-radius: 10px; border-left: 4px solid; }
  .t-15 { background: #c6f6d5; border-color: #38a169; }
  .t-20 { background: #fefcbf; border-color: #d69e2e; }
  .t-30 { background: #feebc8; border-color: #dd6b20; }
  .target-box .pct { font-size: 13px; font-weight: 700; }
  .target-box .price { font-size: 20px; font-weight: 800; margin: 4px 0; }
  .target-box .note { font-size: 11px; color: #4a5568; }
  .reached { background: #2d3748; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-left: 6px; }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th, td { padding: 10px; text-align: center; border-bottom: 1px solid #e2e8f0; }
  th { background: #f7fafc; font-size: 12px; color: #4a5568; font-weight: 700; }
  tr.current { background: #fefcbf !important; font-weight: 700; }
  tr.never { color: #a0aec0; }
  .bar-container { background: #edf2f7; height: 14px; border-radius: 7px; overflow: hidden; }
  .bar-fill { height: 100%; background: linear-gradient(90deg, #4299e1, #3182ce); }
  .bar-fill.zero { background: #cbd5e0; }

  .info-banner { padding: 12px 16px; background: #bee3f8; color: #2a4365; border-radius: 8px;
                 font-size: 13px; margin-bottom: 10px; }

  details { background: #f7fafc; border-radius: 8px; padding: 12px 16px; margin-top: 10px; border: 1px solid #e2e8f0; }
  summary { cursor: pointer; font-weight: 600; color: #2d3748; }
  details .body { margin-top: 10px; font-size: 13px; color: #4a5568; line-height: 1.7; }

  h2.section { font-size: 18px; margin-bottom: 12px; color: #2d3748; }
  .chart-wrap { position: relative; height: 320px; }
  .loading { display: none; text-align: center; padding: 30px; color: #718096; }
  .loading.show { display: block; }
  .hidden { display: none !important; }

  /* 페이지 표시/숨김 - CSS 클래스 기반 */
  .page { display: none; }
  .page.active { display: block; }

  @media (max-width: 640px) {
    .hero { grid-template-columns: 1fr; }
    .hero .arrow { display: none; }
    .hero-box .big { font-size: 22px; }
  }

  /* 헤더 네비게이션 */
  .site-header { background: #2d3748; color: #fff; padding: 0; margin: -16px -16px 20px -16px; }
  .site-header .header-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
  .site-logo { font-size: 18px; font-weight: 800; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
  .site-logo:hover { color: #90cdf4; }
  .site-nav { display: flex; gap: 4px; align-items: center; }
  .site-nav a { color: #cbd5e0; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; transition: all 0.2s; }
  .site-nav a:hover, .site-nav a.active { background: rgba(255,255,255,0.15); color: #fff; }
  .nav-hamburger { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 8px; }
  @media (max-width: 768px) {
    .nav-hamburger { display: block; }
    .site-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: #2d3748; flex-direction: column; padding: 8px 16px 16px; z-index: 100; }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 10px 12px; border-radius: 6px; }
    .site-header { position: relative; }
  }

  /* 푸터 */
  .site-footer { background: #2d3748; color: #a0aec0; margin: 40px -16px -16px -16px; padding: 32px 16px 24px; }
  .site-footer .footer-inner { max-width: 1200px; margin: 0 auto; }
  .footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin-bottom: 24px; }
  .footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
  .footer-col a { display: block; color: #a0aec0; text-decoration: none; font-size: 13px; margin-bottom: 6px; }
  .footer-col a:hover { color: #fff; }
  .footer-col p { font-size: 12px; line-height: 1.6; }
  .footer-bottom { border-top: 1px solid #4a5568; padding-top: 16px; font-size: 12px; text-align: center; }
  .footer-disclaimer { font-size: 11px; color: #718096; margin-top: 8px; line-height: 1.5; }

  /* 페이지 콘텐츠 */
  .page { display: none; }
  .page.active { display: block; }
  .page-hero { background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%); color: #fff; padding: 48px 0 40px; margin: -20px -16px 24px -16px; }
  .page-hero .inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
  .page-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; color: #fff; }
  .page-hero p { font-size: 16px; opacity: 0.85; }

  /* 블로그 */
  .blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 16px; }
  .blog-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.06); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
  .blog-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
  .blog-card-img { height: 140px; display: flex; align-items: center; justify-content: center; font-size: 48px; }
  .blog-card-body { padding: 16px; }
  .blog-card-tag { font-size: 11px; font-weight: 700; color: #4299e1; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
  .blog-card-title { font-size: 15px; font-weight: 700; color: #2d3748; margin-bottom: 8px; line-height: 1.4; }
  .blog-card-excerpt { font-size: 12px; color: #718096; line-height: 1.6; }
  .blog-card-meta { font-size: 11px; color: #a0aec0; margin-top: 10px; }

  /* 블로그 상세 */
  .blog-article { max-width: 780px; margin: 0 auto; }
  .blog-article h1 { font-size: 28px; font-weight: 800; color: #2d3748; margin-bottom: 12px; line-height: 1.3; }
  .blog-article h2 { font-size: 20px; font-weight: 700; color: #2d3748; margin: 28px 0 12px; }
  .blog-article h3 { font-size: 16px; font-weight: 700; color: #4a5568; margin: 20px 0 8px; }
  .blog-article p { font-size: 15px; color: #4a5568; line-height: 1.8; margin-bottom: 16px; }
  .blog-article ul, .blog-article ol { margin: 12px 0 16px 20px; }
  .blog-article li { font-size: 15px; color: #4a5568; line-height: 1.8; margin-bottom: 6px; }
  .blog-article .highlight-box { background: #ebf8ff; border-left: 4px solid #4299e1; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 20px 0; }
  .blog-article .highlight-box p { margin: 0; }
  .blog-article .back-btn { display: inline-flex; align-items: center; gap: 6px; color: #4299e1; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 20px; }
  .blog-article .back-btn:hover { color: #2b6cb0; }
  .blog-article table { margin: 16px 0; }
  .blog-article .article-meta { font-size: 13px; color: #a0aec0; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #e2e8f0; }

  /* 관련 글 & CTA */
  .related-posts { max-width: 780px; margin: 40px auto 0; padding-top: 28px; border-top: 1px solid #e2e8f0; }
  .related-posts h3 { font-size: 16px; font-weight: 700; color: #2d3748; margin-bottom: 14px; }
  .related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .related-card { background: #f7fafc; border-radius: 10px; padding: 14px; cursor: pointer; transition: background 0.2s; }
  .related-card:hover { background: #edf2f7; }
  .related-card-tag { font-size: 10px; font-weight: 700; color: #4299e1; text-transform: uppercase; margin-bottom: 6px; }
  .related-card-title { font-size: 13px; font-weight: 600; color: #2d3748; line-height: 1.5; }
  .blog-cta { max-width: 780px; margin: 24px auto 0; background: linear-gradient(135deg, #4299e1, #3182ce); border-radius: 12px; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .blog-cta-text { color: #fff; font-size: 14px; font-weight: 600; }
  .blog-cta-btn { background: #fff; color: #2b6cb0; border: none; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
  .blog-cta-btn:hover { background: #ebf8ff; }

  /* 도구 페이지 */
  .tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 16px; }
  .tool-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.2s; }
  .tool-card:hover { transform: translateY(-2px); }
  .tool-card .tool-icon { font-size: 36px; margin-bottom: 12px; }
  .tool-card h3 { font-size: 16px; font-weight: 700; color: #2d3748; margin-bottom: 8px; }
  .tool-card p { font-size: 13px; color: #718096; line-height: 1.6; }
  .tool-badge { display: inline-block; background: #c6f6d5; color: #276749; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-top: 10px; }

  /* About/Contact/Policy 페이지 */
  .prose { max-width: 780px; margin: 0 auto; }
  .prose h2 { font-size: 22px; font-weight: 700; color: #2d3748; margin: 28px 0 12px; }
  .prose h3 { font-size: 17px; font-weight: 700; color: #4a5568; margin: 20px 0 8px; }
  .prose p { font-size: 15px; color: #4a5568; line-height: 1.8; margin-bottom: 14px; }
  .prose ul { margin: 10px 0 14px 20px; }
  .prose li { font-size: 15px; color: #4a5568; line-height: 1.8; margin-bottom: 4px; }
  .contact-form input, .contact-form textarea { width: 100%; padding: 10px 14px; border: 1px solid #cbd5e0; border-radius: 8px; font-size: 14px; margin-bottom: 12px; font-family: inherit; }
  .contact-form textarea { height: 120px; resize: vertical; }
  .contact-form .submit-btn { background: #4299e1; color: #fff; border: none; padding: 12px 28px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; }
  .contact-form .submit-btn:hover { background: #3182ce; }
