:root {
    --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    --primary-color: #2563eb;
    --active-color: #dc2626;
    --text-color: #334155;
    --bg-color: #ffffff;
    --sidebar-bg: #f8fafc;
    --badge-bg: #eff6ff;
    --badge-color: #1d4ed8;
    --date-color: #64748b;
    --border-color: #e2e8f0;
}

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

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 사이드바 스타일 */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.25s ease;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

/* 모바일 배경 어둡게 레이어 (Overlay) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #475569;
}

.filter-group input[type="text"],
.filter-group input[type="password"],
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.88rem;
    outline: none;
}

.radio-group label {
    display: block;
    font-weight: normal;
    margin-bottom: 4px;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 8px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

/* 사이드바 피드백 버튼 */
.btn-feedback {
    width: 100%;
    padding: 10px;
    background-color: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

.btn-feedback:hover {
    background-color: #0369a1;
}

.btn-feedback:active {
    transform: scale(0.98);
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

/* 메인 영역 */
.main-container {
    flex: 1;
    margin-left: 280px;
    padding: 16px 28px;
    transition: margin-left 0.25s ease;
    width: calc(100% - 280px);
}

.main-container.expanded {
    margin-left: 0;
    width: 100%;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.top-nav-start {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    word-break: keep-all;
}

.site-name a {
    color: #1e293b;
    text-decoration: none;
}

.site-name a:hover {
    color: var(--primary-color);
}

.site-name a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.toggle-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    color: #1e293b;
    white-space: nowrap;
}

/* 상태 바 깔끔한 2행 줄바꿈 레이아웃 */
.status-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.8rem;
    color: #166534;
    background: #dcfce7;
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.status-badge .badge-line1 {
    display: block;
    white-space: nowrap;
}

.status-badge .badge-line2 {
    display: block;
    font-size: 0.74rem;
    color: #15803d;
    opacity: 0.95;
    white-space: nowrap;
    margin-top: 1px;
}

/* 100% 가로 전면 확장 헤더 박스 */
.header-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 18px 22px;
    border-radius: 10px;
    margin-bottom: 14px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    word-break: keep-all;
    line-height: 1.3;
}

/* (최근 96시간) 전용 줄바꿈 서체 */
.header-title-sub {
    display: block;
    font-size: 0.82em;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 4px;
}

.header-desc {
    font-size: 0.88rem;
    color: #cbd5e1;
    margin-top: 6px;
    word-break: keep-all;
    line-height: 1.4;
}

/* 카테고리 탭 (가로 스크롤 대응) */
.category-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.tab-btn.active {
    color: var(--active-color);
    border-bottom: 2px solid var(--active-color);
    border-radius: 0;
}

.category-caption {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 10px;
}

/* ==========================================================================
   💻 PC 데스크톱 전용 뉴스 리스트 레이아웃 (여유로운 너비 유지)
   ========================================================================== */
.news-list-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
}

.article-row {
    display: grid;
    grid-template-columns: 110px 1fr 140px;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
    min-height: 30px;
}

.article-row-meta {
    display: contents;
}

.mobile-only-date {
    display: none !important;
}

.desktop-only-date {
    display: inline-block !important;
    font-size: 0.82rem;
    color: var(--date-color);
    white-space: nowrap;
    text-align: right;
}

.media-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--badge-bg);
    color: var(--badge-color);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    height: 24px;
    white-space: nowrap;
}

.title-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* 순수 미니멀 텍스트 페이지네이션 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.page-link {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    font-size: 0.92rem;
    font-weight: 500;
    color: #1d4ed8;
    cursor: pointer;
    padding: 2px 6px;
    text-decoration: none;
    white-space: nowrap;
}

.page-link.active {
    color: var(--active-color) !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
}

.page-link:hover {
    color: #2563eb;
}

.page-link.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* 히든 유틸리티 */
.hidden {
    display: none !important;
}

/* 피드백 폼 */
.feedback-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.btn-submit {
    background: var(--active-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   📱 모바일 전용 반응형 UI 및 상태 바
   ========================================================================== */
@media screen and (max-width: 768px) {
    body {
        position: relative;
    }

    .sidebar {
        width: 280px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .main-container {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 10px 12px !important;
    }

    .top-nav {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        margin-bottom: 8px;
    }

    .toggle-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .site-name {
        font-size: 0.95rem;
    }

    .status-badge {
        font-size: 0.72rem;
        padding: 4px 10px;
        line-height: 1.3;
        text-align: right;
        max-width: 82%;
        border-radius: 8px;
        align-items: flex-end;
    }

    .status-badge .badge-line1 {
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .status-badge .badge-line2 {
        font-size: 0.68rem;
        white-space: nowrap;
    }

    .header-box {
        padding: 12px 14px;
        margin-bottom: 10px;
        border-radius: 8px;
    }

    .header-title {
        font-size: 1.1rem;
        line-height: 1.3;
        word-break: keep-all;
    }

    .header-title-sub {
        display: block;
        font-size: 0.8em;
        margin-top: 2px;
        color: #cbd5e1;
    }

    .header-desc {
        font-size: 0.76rem;
        margin-top: 4px;
        line-height: 1.35;
        word-break: keep-all;
        color: #94a3b8;
    }

    .tab-btn {
        font-size: 0.82rem;
        padding: 5px 8px;
    }

    .category-caption {
        font-size: 0.78rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .news-list-container {
        gap: 6px;
        margin-bottom: 16px;
    }

    .article-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9;
        min-height: auto;
    }

    .article-row-meta {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .media-badge {
        font-size: 0.76rem;
        height: 22px;
        padding: 2px 7px;
        border-radius: 4px;
    }

    .mobile-only-date {
        display: inline-block !important;
        font-size: 0.75rem;
        color: #94a3b8;
        text-align: right;
    }

    .desktop-only-date {
        display: none !important;
    }

    .title-link {
        font-size: 0.93rem;
        font-weight: 600;
        line-height: 1.45;
        color: var(--text-color);
        white-space: normal !important;
        word-break: keep-all;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .pagination-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        align-items: center;
        gap: 2px;
        margin-top: 12px;
        padding-top: 10px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pagination-container::-webkit-scrollbar {
        display: none;
    }

    .page-link {
        font-size: 0.8rem;
        padding: 2px 4px;
        flex-shrink: 0;
        white-space: nowrap;
    }
}

.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 0 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: #64748b;
}

.site-footer a {
    color: #475569;
    text-decoration: none;
}

.site-footer a:hover,
.sidebar-site-nav a:hover,
.opinion-compact a:hover,
.opinion-archive-list a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.site-footer a:focus-visible,
.sidebar-site-nav a:focus-visible,
.opinion-compact a:focus-visible,
.opinion-archive-list a:focus-visible,
.opinion-pager a:focus-visible,
.policy-back a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sidebar-site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
}

.sidebar-site-nav a {
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
}

.news-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    min-width: 0;
    max-width: 100%;
}

.news-search label {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.news-search input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.92rem;
}

.news-search button {
    flex: 0 0 auto;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.news-search input:focus-visible,
.news-search button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.opinion-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin: 0 0 12px;
    padding: 8px 12px 8px 14px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-left: 4px solid #9f1239;
    border-radius: 8px;
    font-size: 0.92rem;
}

.opinion-label {
    color: #9f1239;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.opinion-compact .opinion-title {
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

.opinion-compact .opinion-all {
    color: #9f1239;
    font-weight: 700;
    text-decoration: none;
}

.opinion-compact .opinion-teaser {
    color: #475569;
    min-width: 0;
    flex: 1 1 12rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.opinion-compact time {
    color: #64748b;
    font-size: 0.82rem;
}

.opinion-archive-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.opinion-archive-list li {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.opinion-archive-list a {
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

.opinion-archive-list span,
.opinion-archive-list time {
    display: block;
    margin-top: 4px;
}

.opinion-archive-list span {
    color: #475569;
}

.opinion-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 20px;
}

.opinion-pager a,
.opinion-pager span {
    min-width: 2rem;
    text-align: center;
}

body.policy-page {
    display: block;
    background: var(--sidebar-bg);
}

.policy-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 20px 48px;
    background: #fff;
    min-height: 100vh;
}

.policy-back {
    margin-bottom: 16px;
    font-size: 0.88rem;
}

.policy-back a {
    color: var(--primary-color);
    text-decoration: none;
}

.policy-wrap h1 {
    font-size: 1.4rem;
    color: #1e293b;
    margin-bottom: 16px;
}

.policy-wrap h2 {
    font-size: 1.05rem;
    color: #1e293b;
    margin: 22px 0 8px;
}

.policy-wrap p,
.policy-wrap li {
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 10px;
}

.policy-wrap ul {
    padding-left: 1.2rem;
    margin-bottom: 10px;
}

.policy-wrap a {
    color: var(--primary-color);
}

.published-briefings {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.published-briefings h2 {
    font-size: 1.15rem;
    line-height: 1.45;
    margin: 0 0 8px;
}

.briefing-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #9a3412;
}

.briefing-teaser + .briefing-teaser {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.briefing-teaser p {
    margin: 0 0 8px;
    line-height: 1.6;
}

.policy-wrap article p {
    font-size: 1.05rem;
    line-height: 1.85;
    word-break: keep-all;
}

@media (max-width: 768px) {
    .policy-wrap {
        padding: 20px 16px 40px;
    }

    .policy-wrap h1,
    .published-briefings h2 {
        font-size: 1.28rem;
        line-height: 1.4;
    }
}

.published-briefings ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.published-briefings li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}

.published-briefings time {
    color: #64748b;
    font-size: 0.82rem;
    white-space: nowrap;
}

.briefing-banner {
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 6px;
}
