:root {
    color-scheme: light;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #172033;
    --muted: #64748b;
    --line: #d9e2ec;
    --danger: #dc2626;
    --surface: #ffffff;
    --background: #f5f8fc;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
    word-break: keep-all;
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 38px 20px;
}

.block-card {
    width: min(820px, 100%);
    padding: 48px 56px 44px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(36, 57, 87, 0.09);
}

.city-logo {
    display: block;
    width: 190px;
    max-width: 52%;
    height: auto;
    margin: 0 0 28px;
}

h1 {
    margin: 18px 0 14px;
    font-size: clamp(30px, 5vw, 42px);
    line-height: 1.25;
    letter-spacing: -0.045em;
}

.description {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
    letter-spacing: -0.015em;
}

/* [상세보기] 텍스트 클릭 링크 (별도 박스/버튼 스타일 없이 텍스트 본문과 자연스럽게 어우러짐) */
.detected-text-link {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 750;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.detected-text-link:hover {
    color: var(--primary);
}

.illustration-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0 12px;
}

.illustration {
    display: block;
    width: min(74%, 410px);
    height: auto;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 28px;
}

.back-button {
    min-width: 186px;
    height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--primary);
    font: inherit;
    font-size: 15px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
    transition: background 0.15s ease-in-out;
}

.back-button:hover { background: var(--primary-dark); }
.back-button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.3); outline-offset: 3px; }

/* =========================================================================
   모달(Modal) 팝업 스타일
   ========================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.18s ease-out;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    width: min(620px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    border: 1px solid var(--line);
    overflow: hidden;
    animation: slideUp 0.18s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.modal-close-icon {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.modal-close-icon:hover {
    color: var(--text);
    background: #e2e8f0;
}

/* 모달 바디: Y축 스크롤 */
.modal-body {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 460px;
}

.modal-body-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 대분류 섹션 (본문 / 첨부파일) */
.modal-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}

.modal-section-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
}

/* 첨부파일 파일별 그룹 */
.modal-file-group {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-file-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 750;
    color: #334155;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
}

.modal-file-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

.modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.modal-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 13.5px;
    align-items: center;
}

.modal-item-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1e3a8a;
    background: #dbeafe;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12.5px;
    text-align: center;
    white-space: nowrap;
}

.modal-item-values {
    color: #1e293b;
    line-height: 1.5;
    word-break: break-all;
    font-variant-numeric: tabular-nums;
}

.val-more {
    display: inline-block;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11.5px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.modal-close-btn {
    height: 40px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.modal-close-btn:hover {
    background: #f1f5f9;
}

@media (max-width: 600px) {
    .page { padding: 18px 12px; }
    .block-card { padding: 32px 22px 30px; border-radius: 16px; }
    .illustration { width: min(88%, 350px); }
    .modal-item { grid-template-columns: 1fr; gap: 6px; }
    .actions { flex-wrap: wrap; }
    .back-button { width: 100%; }
}
