/**
 * MiniWindo 계산기 플랫폼 스타일시트
 * 모바일 퍼스트 디자인 (375px ~ 1920px)
 * 프레임워크 없이 순수 CSS로 구현
 */

/* ========================================
   CSS 변수 (색상, 간격, 폰트)
   ======================================== */
:root {
    /* 메인 컬러 */
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #3385d6;

    /* 강조 컬러 */
    --accent: #059669;
    --accent-dark: #047857;

    /* 텍스트 컬러 */
    --text: #1F2937;
    --text-light: #555555;   /* WCAG 2.2 AA: 대비 8.6:1 (AAA) — 변경 전 #6B7280 */
    --text-muted: #767676;   /* WCAG 2.2 AA: 대비 4.5:1 (AA) — 변경 전 #9CA3AF */

    /* 배경 컬러 */
    --bg: #FFFFFF;
    --bg-gray: #F9FAFB;
    --bg-dark: #F3F4F6;

    /* 보더 컬러 */
    --border: #E5E7EB;
    --border-dark: #D1D5DB;

    /* 상태 컬러 */
    --success: #0D7A3F;  /* WCAG 2.2 AA: 대비 5.1:1 — 변경 전 #10B981 */
    --warning: #92600A;  /* WCAG 2.2 AA: 대비 4.8:1 — 변경 전 #F59E0B */
    --error: #C42B2B;    /* WCAG 2.2 AA: 대비 4.6:1 — 변경 전 #EF4444 */
    --info: #1A6FB5;     /* WCAG 2.2 AA: 대비 4.7:1 — 변경 전 #3B82F6 */

    /* 레이아웃 */
    --max-width: 720px;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    /* 간격 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* 폰트 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;

    /* 그림자 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* ========================================
   기본 리셋 및 전역 스타일
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-gray);
}

/* ========================================
   레이아웃 - 컨테이너
   ======================================== */
.container {
    max-width: 100%;
    width: 100%;
    padding: 0 var(--spacing-md);
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: var(--max-width);
    }
}

/* ========================================
   헤더
   ======================================== */
.site-header {
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    margin-bottom: var(--spacing-md);
}

.logo a {
    text-decoration: none;
    color: var(--primary);
}

.logo h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin: 0;
}

/* 카테고리 네비게이션 (모바일 가로스크롤) */
.category-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.category-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.category-list {
    display: flex;
    gap: var(--spacing-sm);
    list-style: none;
    white-space: nowrap;
}

.category-item {
    flex-shrink: 0;
}

.category-link {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-gray);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.category-link:hover,
.category-link:focus {
    background-color: var(--primary);
    color: var(--bg);
}

/* ========================================
   빵부스러기 네비게이션
   ======================================== */
.breadcrumb {
    padding: var(--spacing-md) 0;
    background-color: var(--bg-gray);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    list-style: none;
    font-size: var(--font-size-sm);
}

.breadcrumb-item {
    color: var(--text-light);
}

.breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin-left: var(--spacing-sm);
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text);
}

/* ========================================
   메인 콘텐츠
   ======================================== */
.site-main {
    padding: var(--spacing-xl) 0;
    min-height: 60vh;
}

/* ========================================
   광고 슬롯 (승인 전 숨김)
   ======================================== */
.ad-slot {
    margin: var(--spacing-xl) auto;
    padding: var(--spacing-md);
    background-color: var(--bg-dark);
    border-radius: var(--radius);
    text-align: center;
    min-height: 100px;
}

/* ========================================
   카드 스타일
   ======================================== */
.calc-card,
.result-card,
.content-card,
.category-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   계산기 헤더
   ======================================== */
.calc-header {
    margin-bottom: var(--spacing-xl);
}

.calc-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--spacing-md);
}

.calc-intro {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    line-height: 1.6;
}

/* ========================================
   계산기 섹션
   ======================================== */
.calc-section {
    margin-bottom: var(--spacing-xl);
}

/* 입력 폼 그룹 */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text);
    font-size: var(--font-size-base);
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px var(--spacing-md);
    border: 2px solid #767676; /* WCAG 2.2 SC 1.4.11: UI 컴포넌트 border 최소 3:1 — 변경 전 var(--border) */
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-input:hover,
.form-select:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.08);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15), 0 4px 12px rgba(0, 102, 204, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #767676; /* WCAG 2.2 AA: 대비 4.5:1 — 변경 전 var(--text-muted) opacity:0.7 */
}

.form-help {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
}

/* 버튼 */
.btn {
    display: inline-block;
    padding: 14px var(--spacing-xl);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: var(--bg);
    position: relative;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3385d6 0%, #0066cc 100%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--radius-lg);
}

.btn-primary:hover::after,
.btn-primary:focus::after {
    opacity: 1;
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #E5E7EB 0%, #D1D5DB 100%);
    border-color: var(--border-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: var(--bg);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-group {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* ========================================
   결과 표시
   ======================================== */
.result-section {
    margin-bottom: var(--spacing-xl);
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: var(--bg);
    padding: var(--spacing-xl);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.result-highlight {
    text-align: center;
    padding: var(--spacing-xl);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

.result-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.result-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.result-unit {
    font-size: var(--font-size-lg);
    opacity: 0.8;
}

.result-details {
    background-color: var(--bg);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row-label {
    font-weight: 500;
    color: var(--text-light);
}

.result-row-value {
    font-weight: 600;
    color: var(--text);
}

/* ========================================
   면책 조항
   ======================================== */
.disclaimer-section {
    margin-bottom: var(--spacing-xl);
}

.disclaimer {
    background-color: #FEF3C7;
    border-left: 4px solid var(--warning);
    padding: var(--spacing-lg);
    border-radius: var(--radius);
}

.disclaimer h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
    color: var(--text);
}

.disclaimer p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.disclaimer p:last-child {
    margin-bottom: 0;
}

/* ========================================
   내부 링크
   ======================================== */
.internal-links-section {
    margin-bottom: var(--spacing-xl);
}

.internal-links {
    padding: var(--spacing-lg);
    background-color: var(--bg-gray);
    border-radius: var(--radius);
}

.internal-links p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.internal-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.internal-links a:hover {
    text-decoration: underline;
}

/* ========================================
   콘텐츠 섹션 (SEO)
   ======================================== */
.content-section {
    margin-bottom: var(--spacing-xl);
}

.content-card h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.content-card h3 {
    font-size: var(--font-size-xl);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text);
}

.content-card p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    color: var(--text-light);
}

.content-card ul,
.content-card ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.content-card li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.disclaimer-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
    margin-top: var(--spacing-lg);
}

/* ========================================
   FAQ 섹션
   ======================================== */
.faq-section {
    margin-bottom: var(--spacing-xl);
}

.faq-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.faq-list {
    background-color: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: var(--spacing-lg);
    background-color: var(--bg);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text);
    transition: background-color 0.2s;
}

.faq-question:hover {
    background-color: var(--bg-gray);
}

.faq-q-text {
    flex: 1;
}

.faq-icon {
    font-size: var(--font-size-2xl);
    color: var(--primary);
    font-weight: 400;
    width: 24px;
    text-align: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer {
    background-color: #FAFAFA;
}
.faq-answer p {
    padding: 0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
    color: #333333;
    line-height: 1.6;
}

/* ========================================
   SNS 공유 버튼
   ======================================== */
.share-section {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.share-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
    color: var(--text);
}

.share-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
}

.share-btn.kakao {
    background-color: #FEE500;
    color: #000000;
}

.share-btn.facebook {
    background-color: #1877F2;
    color: var(--bg);
}

.share-btn.link {
    background-color: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--border);
}

/* 전달하기 버튼 */
.share-btn.forward {
    background-color: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--border);
}
.share-btn.forward:hover {
    background-color: #D1D5DB;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   관련 계산기
   ======================================== */
.related-section {
    margin-bottom: var(--spacing-xl);
}

.related-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 480px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.related-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    transition: all 0.2s;
}

.related-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.related-link {
    text-decoration: none;
    display: block;
}

.related-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.related-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
}

/* ========================================
   홈페이지 - 인트로 섹션
   ======================================== */
.intro-section {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg);
    border-radius: var(--radius-lg);
}

.intro-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.intro-desc {
    font-size: var(--font-size-lg);
    line-height: 1.6;
    opacity: 0.95;
}

/* ========================================
   홈페이지 - 섹션 타이틀
   ======================================== */
.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text);
}

.section-desc {
    font-size: var(--font-size-base);
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   홈페이지 - 인기/최근 계산기 그리드
   ======================================== */
.popular-section,
.recent-section {
    margin-bottom: var(--spacing-2xl);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 480px) {
    .calc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .calc-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.calc-card-home,
.calc-card-list {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.2s;
    height: 100%;
}

.calc-card-home:hover,
.calc-card-list:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.calc-card-link {
    text-decoration: none;
    display: block;
}

.calc-card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.calc-card-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.calc-card-category {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--primary);
    background-color: rgba(0, 102, 204, 0.1);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.calc-card-stats {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ========================================
   홈페이지 - 카테고리 그리드
   ======================================== */
.category-section {
    margin-bottom: var(--spacing-2xl);
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card-link {
    text-decoration: none;
    display: block;
}

.category-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.category-card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.category-card-count {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.category-card-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
}

/* ========================================
   홈페이지 - 사이트 소개
   ======================================== */
.about-section {
    margin-bottom: var(--spacing-2xl);
}

.about-content {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.about-content h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.about-content p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    color: var(--text-light);
}

/* ========================================
   홈페이지 - 최근 계산기 리스트
   ======================================== */
.calc-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.calc-list-item {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    transition: all 0.2s;
}

.calc-list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.calc-list-link {
    text-decoration: none;
    display: block;
}

.calc-list-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.calc-list-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.calc-list-category {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--accent);
    background-color: rgba(5, 150, 105, 0.1);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ========================================
   카테고리 페이지
   ======================================== */
.category-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.category-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--spacing-md);
}

.category-description {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.category-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.calculators-section {
    margin-bottom: var(--spacing-xl);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}

.category-content {
    margin-bottom: var(--spacing-xl);
}

.other-categories {
    margin-bottom: var(--spacing-xl);
}

.category-list-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.category-link-item {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all 0.2s;
}

.category-link-item:hover {
    background-color: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

/* ========================================
   푸터
   ======================================== */
.site-footer {
    background-color: var(--text);
    color: var(--bg);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-nav {
    margin-bottom: var(--spacing-lg);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md) var(--spacing-lg);
    list-style: none;
}

.footer-links a {
    color: var(--bg);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.copyright {
    text-align: center;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   계산기 입력 폼 (calculator templates)
   ======================================== */

/* 입력 그룹 */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

/* 숫자 입력 (num-input) */
.num-input,
.calc-input,
.input-field,
.select-input,
.calc-select,
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #767676; /* WCAG 2.2 SC 1.4.11: UI 컴포넌트 border 최소 3:1 — 변경 전 #E5E7EB */
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font-family);
    color: var(--text);
    background: #fff;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    appearance: none;
    -webkit-appearance: none;
}

.num-input:hover,
.calc-input:hover,
.input-field:hover,
.select-input:hover,
.calc-select:hover,
.form-control:hover {
    border-color: #3B82F6; /* WCAG 2.2 SC 1.4.11: hover border 대비 3.3:1 — 변경 전 #93C5FD (2.2:1 미달) */
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.num-input:focus,
.calc-input:focus,
.input-field:focus,
.select-input:focus,
.calc-select:focus,
.form-control:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.num-input::placeholder,
.calc-input::placeholder,
.input-field::placeholder {
    color: #767676; /* WCAG 2.2 AA: 대비 4.5:1 — 변경 전 #C0C7D2 (1.5:1 미달) */
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* 라디오 그룹 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid #767676; /* WCAG 2.2 SC 1.4.11: UI 컴포넌트 border 최소 3:1 — 변경 전 #E5E7EB */
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: #fff;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: #3B82F6; /* WCAG 2.2 SC 1.4.11: hover border 대비 3.3:1 — 변경 전 #93C5FD (2.2:1 미달) */
    background: #EFF6FF;
}

.radio-label input[type="radio"] {
    accent-color: #3B82F6;
}

.radio-label input[type="radio"]:checked ~ span,
.radio-label:has(input:checked) {
    color: #2563EB;
}

.radio-label:has(input:checked) {
    border-color: #3B82F6;
    background: #EFF6FF;
    font-weight: 600;
}

/* 계산 버튼 영역 */
.calc-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* 계산하기 버튼 */
.btn-calculate {
    flex: 1;
    padding: 16px 24px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn-calculate::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 12px;
}

.btn-calculate:hover::after { opacity: 1; }

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.btn-calculate:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* 다시하기 버튼 */
.btn-reset {
    padding: 16px 20px;
    background: #F3F4F6;
    color: #555555; /* WCAG 2.2 AA: 대비 8.6:1 — 변경 전 #6B7280 */
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-reset:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
    color: var(--text);
    transform: translateY(-1px);
}

/* ========================================
   계산 결과 테이블
   ======================================== */

/* 결과 상세 */
.result-detail {
    margin-top: 20px;
}

/* 결과 테이블 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    overflow: hidden;
}

.result-table th,
.result-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.result-table th {
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    width: 55%;
}

.result-table td {
    font-weight: 600;
    color: #fff;
    text-align: right;
}

.result-table tr:last-child th,
.result-table tr:last-child td {
    border-bottom: none;
}

.result-table tr.divider th {
    background: rgba(255,255,255,0.1);
    font-weight: 700;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.7);
}

.result-table tr.total-row th,
.result-table tr.total-row td {
    background: rgba(255,255,255,0.2);
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.result-table tr.highlight-row th,
.result-table tr.highlight-row td {
    background: rgba(255,255,255,0.15);
    font-weight: 700;
    color: #fff;
}

.result-table tr.sub-total th,
.result-table tr.sub-total td {
    background: rgba(0,0,0,0.1);
    font-weight: 700;
}

/* 결과 강조 */
.result-info {
    margin-top: 16px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 14px 16px;
}

.result-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    margin-bottom: 4px;
}

/* 정보 박스 */
.info-box {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #1E40AF;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

.info-table th,
.info-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.info-table th {
    background: var(--bg-gray);
    font-weight: 600;
    color: var(--text);
}

.info-table td {
    color: var(--text-light);
}

.info-text {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

.table-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 연봉 테이블 */
.salary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 16px;
}

.salary-table th,
.salary-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: right;
}

.salary-table th {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.salary-table tr:nth-child(even) td {
    background: var(--bg-gray);
}

.salary-table tr:hover td {
    background: #EFF6FF;
}

.salary-table .highlight {
    background: #FEF9C3 !important;
    font-weight: 700;
    color: #92400E;
}

.highlight-text {
    color: #2563EB;
    font-weight: 700;
}

/* 결과 카드 히든 -> 표시 애니메이션 */
.result-card {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   유틸리티 클래스
   ======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ========================================
   반응형 - 태블릿 이상
   ======================================== */
@media (min-width: 768px) {
    .logo {
        margin-bottom: var(--spacing-lg);
    }

    .logo h1 {
        font-size: var(--font-size-3xl);
    }

    .calc-title {
        font-size: 36px;
    }

    .intro-title {
        font-size: 40px;
    }
}

/* ========================================
   계산기 결과 상세 행 (dark card 내부용)
   ======================================== */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
.detail-value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    text-align: right;
}

/* 체크박스 레이블 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    padding: 4px 0;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563EB;
    cursor: pointer;
}

/* 랜덤 숫자 결과 표시 */
.random-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 8px 0;
}
.random-number-badge {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    min-width: 48px;
    text-align: center;
}

/* ========================================
   계산기 검색 버튼 & 모달
   ======================================== */
/* 헤더 래퍼 (로고 + 검색버튼 같은 행) */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

/* 검색 버튼 */
.search-trigger-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #2563EB;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
}
.search-trigger-btn:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.search-trigger-btn svg {
    width: 18px;
    height: 18px;
}

/* 배너 영역 (추후 광고 교체용) */
.header-banner-area {
    /* 광고 배너로 교체 시 이 영역 활용 */
    /* display:none 처리 후 광고 삽입 */
}

/* 검색 모달 오버레이 */
.search-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}
.search-modal-overlay.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 검색 모달 컨테이너 */
.search-modal {
    background: #ffffff;
    color: #333333;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 var(--spacing-md);
    animation: slideDown 0.25s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 검색 입력 영역 */
.search-modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}
.search-modal-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #767676;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: #333333;
    background: #ffffff;
    outline: none;
}
.search-modal-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-modal-input::placeholder {
    color: #767676;
}
.search-modal-close {
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #555555;
    font-size: 24px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}
.search-modal-close:hover {
    background: #F0F0F0;
    color: #333333;
}

/* 검색 결과 목록 */
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm) 0;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    text-decoration: none;
    color: #333333;
    border-bottom: 1px solid #F0F0F0;
    transition: background 0.15s;
}
.search-result-item:hover {
    background: #F5F8FF;
    color: #1A1A1A;
}
.search-result-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border: 1px solid #BFDBFE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-category {
    font-size: var(--font-size-xs);
    color: #555555;
}
.search-result-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.search-stat {
    font-size: 12px;
    color: #767676;
    white-space: nowrap;
}
.search-stat.views::before { content: "👁 "; }
.search-stat.likes::before { content: "❤ "; }
.search-empty {
    text-align: center;
    padding: var(--spacing-2xl);
    color: #767676;
    font-size: var(--font-size-sm);
}

/* ========================================
   좋아요 버튼
   ======================================== */
.like-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #fff;
    color: #555555;
    border: 2px solid #D1D5DB;
    border-radius: 50px;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s;
    min-height: 44px;
}
.like-btn:hover {
    border-color: #E11D48;
    color: #E11D48;
    background: #FFF1F2;
    transform: translateY(-1px);
}
.like-btn.liked {
    background: #FFF1F2;
    border-color: #E11D48;
    color: #E11D48;
}
.like-count {
    font-weight: 700;
}

/* ========================================
   브랜드 로고 스타일
   ======================================== */
.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    height: 88px;
    width: auto;
    display: block;
}

@media (min-width: 768px) {
    .site-logo {
        height: 112px;
    }
}

/* ========================================
   국가/언어 선택기 (헤더)
   ======================================== */
.lang-switcher {
    position: relative;
    flex-shrink: 0;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.lang-btn:hover {
    border-color: #C9A84C;
    background: rgba(201,168,76,0.06);
}

.current-flag {
    display: inline-flex;
    align-items: center;
}

.flag-img-btn {
    width: 28px;
    height: 21px;
    border-radius: 2px;
    object-fit: cover;
    display: block;
}

.flag-img {
    width: 28px;
    height: 21px;
    border-radius: 2px;
    object-fit: cover;
    display: block;
}

.current-code {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #374151;
}

.dropdown-arrow {
    width: 10px;
    height: 6px;
    color: #9CA3AF;
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* 드롭다운 열릴 때 화살표 회전 */
.lang-dropdown.open ~ .lang-btn .dropdown-arrow,
.lang-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* 드롭다운 패널 */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 8px;
    z-index: 200;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 국가 선택 버튼 */
.lang-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    min-width: 36px;
}

.lang-option:hover {
    background: #F3F4F6;
    border-color: #E5E7EB;
}

.lang-option.selected {
    background: rgba(201,168,76,0.10);
    border-color: #C9A84C;
}

.lang-code {
    font-size: 9px;
    font-weight: 700;
    color: #6B7280;
    letter-spacing: 0.3px;
}

/* 모바일: 드롭다운 위치 조정 */
@media (max-width: 480px) {
    .lang-dropdown {
        left: auto;
        right: -8px;
        transform: none;
        grid-template-columns: repeat(4, 1fr);
        min-width: 180px;
    }
}

/* ========================================
   인쇄 스타일
   ======================================== */
@media print {
    .site-header,
    .site-footer,
    .breadcrumb,
    .ad-slot,
    .share-section,
    .related-section {
        display: none;
    }

    .site-main {
        padding: 0;
    }

    .calc-card,
    .result-card,
    .content-card {
        box-shadow: none;
        border: 1px solid var(--border);
    }
}
