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

/* v163.17f: 페이지 로드 시 모든 transition 비활성화 (애니메이션 깜박임 방지) */
.preload * {
    transition: none !important;
}

/* v164: SVG 아이콘 (Font Awesome 대체) */
.icon-svg {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
}

:root {
    /* Colors - White & Blue Theme */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #60a5fa;
    --accent-color: #0ea5e9;
    --danger-color: #ef4444;
    --success-color: #10b981;
    
    /* Background Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    
    /* Text Colors - Dark for Light Background */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;  /* 대비 개선: #94a3b8 → #64748b (4.5:1 이상) */
    
    /* Border & Shadow */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(37, 99, 235, 0.15);
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* v163.7i: 푸터를 하단에 고정하기 위한 flex 레이아웃 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    z-index: 1000;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(37, 99, 235, 0.08);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    min-height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.nav-list {
    list-style: none;
}

.nav-section-title {
    padding: 20px 20px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
}

.nav-item {
    margin: 4px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active .nav-link {
    background: var(--primary-color);
    color: white;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
}

/* Favorite Icon */
.favorite-icon {
    margin-left: auto;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 4px;
    z-index: 10;
}

.favorite-icon:hover {
    color: var(--text-secondary);
    transform: scale(1.1);
}

.favorite-icon.active {
    color: var(--text-secondary);
    font-weight: 900;
}

.favorite-icon.active::before {
    content: "\f005";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Active nav item with favorite */
.nav-item.active .favorite-icon {
    color: rgba(255, 255, 255, 0.6);
}

.nav-item.active .favorite-icon.active {
    color: white;
}

.nav-item.active .favorite-icon:hover {
    color: white;
    transform: scale(1.1);
}

.nav-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: white;
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-item.active .nav-badge {
    background: white;
    color: var(--primary-color);
}

.nav-item:not(.active) .nav-badge {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.nav-link:hover .nav-badge {
    background: white;
    color: var(--primary-color);
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .nav-badge {
    display: none;
}

.sidebar.collapsed .favorite-icon {
    display: none;
}

/* Tooltip for collapsed sidebar */
.nav-link {
    position: relative;
}

.sidebar.collapsed .nav-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.sidebar.collapsed .nav-link:hover::after {
    opacity: 1;
}

/* Sidebar Stats */
.sidebar-stats {
    margin-top: auto;
    padding: 12px 8px 16px 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-stats {
    display: none !important;
}

/* Stats Header - Visit Counter (2x2 grid) */
.sidebar-stats-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.visit-counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.visit-counter-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.visit-counter-value {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1;
}

/* Stats Grid Container (2x2 grid like visit counter) */
.sidebar-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sidebar-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    transition: var(--transition-fast);
    gap: 4px;
}

.sidebar-stat-card:hover .sidebar-stat-value {
    color: var(--primary-color);
}

.sidebar-stat-icon {
    display: none !important;
}

.sidebar-stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
}

.sidebar-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1;
    transition: var(--transition-fast);
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sidebar.collapsed .user-info {
    display: none;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Header */
.top-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(10px);
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: start;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

/* Mark All as Read Button */
.mark-all-read-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: white;
    color: #6b7280; /* Gray text */
    border: 1px solid #d1d5db; /* Gray border */
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600; /* 500 → 600 (unread-badge와 동일) */
    font-size: 0.95rem; /* 0.9rem → 0.95rem (unread-badge와 동일) */
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    height: 44px; /* 명시적 높이 지정 */
}

.mark-all-read-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #4b5563;
}

.mark-all-read-btn:active {
    transform: scale(0.98);
}

.mark-all-read-btn i {
    font-size: 1.1rem; /* 0.95rem → 1.1rem (unread-badge와 동일) */
}

.unread-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    cursor: default;
    transition: var(--transition-fast);
    min-width: 80px;
    height: 44px; /* 명시적 높이 지정 */
}

.unread-badge i {
    font-size: 1.1rem;
    animation: bellRing 2s ease-in-out infinite;
}

.unread-count {
    font-size: 1rem;
    font-weight: 700;
}

/* Unread badge empty state (0 unread) */
.unread-badge-empty {
    background: #94a3b8 !important; /* Gray color */
    box-shadow: 0 2px 4px rgba(148, 163, 184, 0.2) !important;
}

.unread-badge-empty i {
    animation: none !important; /* Remove bell animation */
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 400px;
    transition: var(--transition-fast);
    justify-self: center;
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-container i {
    color: var(--text-secondary);
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 100%;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Main Content */
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1; /* v163.7i: 남은 공간을 모두 차지 */
    padding: 30px;
    display: flex;
    flex-direction: column;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    min-height: calc(100vh - 220px); /* 푸터가 올라오지 않도록 */
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Error Message */
.error-message {
    background: var(--card-bg);
    border: 2px solid var(--danger-color);
    color: var(--text-primary);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 40px 0;
    min-height: calc(100vh - 300px); /* 푸터가 올라오지 않도록 */
}

.error-message i {
    font-size: 3rem;
    color: var(--danger-color);
    margin-bottom: 15px;
}

/* News Grid - CSS Grid Layout (전체 너비 활용) */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    width: 100%;
    padding: 24px; /* 상하좌우 여백 추가 (카드 간격과 동일) */
    flex: 1; /* v163.7i: 남은 공간 모두 차지 */
    align-content: start; /* 카드를 위쪽부터 배치 */
}

.news-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    /* v163.17d: 초기 로딩 시 transition 제거 (크기 변화 애니메이션 방지) */
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    max-width: 500px; /* 카드 최대 너비 제한 */
    /* v163.7o: 프로덕션 방식으로 복구 - 가변 높이 */
    /* 렌더링 최적화 */
    contain: layout style paint;
    content-visibility: auto;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* 읽은 카드 스타일 */
.news-card.read {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.news-card.read:hover {
    opacity: 0.7;
}

/* 읽은 카드의 소스 배지 */
.news-card.read .news-source {
    background: #94a3b8;  /* 회색 배경 */
    color: white;
}

/* 이미지가 없는 카드는 컨텐츠만 */
.news-card.no-image {
    /* v163.7o: 프로덕션 방식 복구 */
}

.news-card.no-image .news-content {
    /* v163.15b: 이미지 박스가 있으므로 padding-top 제거 */
    padding-top: 20px; /* 기본값으로 통일 */
}

.news-image-container {
    width: 100%;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    height: 100%;
}

.placeholder-icon {
    font-size: 3rem;
    color: #2563eb;
    opacity: 0.3;
    margin: 0;
    line-height: 1;
}

.placeholder-text {
    margin: 10px 0 0 0;
    padding: 0;
    color: #64748b;
    font-size: 0.9rem;
    opacity: 0.6;
    line-height: 1.2;
}

/* 실제 이미지 */
.news-image {
    width: 100%;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    /* 이미지 렌더링 최적화 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
    will-change: transform;
    content-visibility: auto;
}

/* 이미지가 있을 때 배경 변경 */
.news-image-container.has-image {
    background: var(--bg-secondary);
    position: relative; /* placeholder를 위한 상대 위치 */
}

/* 이미지 로딩 placeholder (v163.16) */
.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e2e8f0; /* 연한 회색 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* 이미지 아래 */
}

.image-placeholder i {
    font-size: 4rem; /* 큰 아이콘 */
    color: #94a3b8; /* 중간 회색 (튀지 않게) */
    opacity: 0.5; /* 약간 투명하게 */
}

/* 실제 이미지 스타일 */
.news-image-container.has-image .news-image {
    position: relative;
    z-index: 2; /* placeholder 위 */
    opacity: 0; /* 로딩 전 숨김 */
    transition: opacity 0.3s ease; /* 부드러운 전환 */
}

/* 이미지가 없을 때 회색 박스 + 게임패드 아이콘 (v163.15) */
.news-image-container.no-image {
    background: #e2e8f0; /* 연한 회색 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-image-container.no-image i {
    font-size: 4rem; /* 큰 아이콘 */
    color: #94a3b8; /* 중간 회색 (튀지 않게) */
    opacity: 0.5; /* 약간 투명하게 */
}

.news-content {
    padding: 20px;
    flex: 1; /* v163.7L: 남은 공간 모두 차지 */
    display: flex;
    flex-direction: column;
    min-height: 0; /* flex 자식이 overflow 처리되도록 */
}

.news-source {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
}

.news-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.news-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    flex: 1; /* v163.7r: 남은 공간 모두 채우기 */
    font-size: 0.9rem;
    line-height: 1.6;
    /* v163.7r: line-clamp 제거 - 최대한 내용 표시 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6; /* v163.7r: 3줄 → 6줄로 확대 */
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: auto; /* v163.7L: 하단 고정 */
    flex-shrink: 0; /* v163.7L: 축소 방지 */
}

.news-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-link {
    display: none;
}

/* Load More - 무한 스크롤로 숨김 */
.load-more-container {
    text-align: center;
    padding: 20px 0;
    display: none !important;  /* 무한 스크롤 사용 시 숨김 */
}

.btn-load-more {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 36px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-load-more:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* Infinite Scroll Loading Indicator */
.infinite-scroll-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.infinite-scroll-loading i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
    display: block;
    margin-bottom: 15px;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px 30px;
    margin-top: auto;
    flex-shrink: 0; /* 푸터가 축소되지 않도록 */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-ceo {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 15px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: var(--transition-fast);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-container {
        min-width: 200px;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Google AdSense 광고 카드 스타일 (v163.5)
   ============================================ */

/* 광고 컨테이너 (뉴스 카드와 동일한 크기) */
.adsbygoogle {
    /* v163.7o: 프로덕션 방식 - 최소/최대 높이만 제한 */
    max-width: 500px !important;
    min-height: 400px !important;
    max-height: 600px !important;
    
    /* 카드처럼 보이도록 스타일 */
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    overflow: hidden !important;
    
    /* 그리드 내 배치 */
    display: block !important;
    margin: 0 auto !important;
    
    /* 광고가 너무 크게 렌더링되지 않도록 */
    box-sizing: border-box !important;
}

/* 광고 내부 iframe 크기 제한 */
.adsbygoogle ins,
.adsbygoogle iframe {
    max-width: 100% !important;
    max-height: 600px !important; /* v163.7o: 프로덕션 방식 */
}

/* v163.7p: 광고 카드 내부 텍스트 제한 해제 */
.adsbygoogle * {
    -webkit-line-clamp: unset !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Masonry 그리드 내 광고 아이템 */
.news-grid .adsbygoogle {
    /* 뉴스 카드와 동일하게 취급 */
    width: 100% !important;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .sidebar-stats {
        padding: 10px 6px 14px 6px;
        gap: 8px;
    }
    
    .sidebar-stats-header {
        padding-bottom: 8px;
        gap: 6px;
    }
    
    .sidebar-stats-grid {
        gap: 6px;
    }
    
    .visit-counter-label {
        font-size: 0.65rem;
    }
    
    .visit-counter-value {
        font-size: 1.1rem;
    }
    
    .sidebar-stat-label {
        font-size: 0.65rem;
    }
    
    .sidebar-stat-value {
        font-size: 1.1rem;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .sidebar.collapsed ~ .main-wrapper {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .page-title {
        font-size: 1rem; /* v163.17f: 1.2rem → 1rem (줄바꿈 방지) */
    }
    
    .search-container {
        display: none;
    }
    
    .top-header {
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
    }
    
    .header-left {
        justify-self: auto;
    }
    
    .header-right {
        justify-self: auto;
        margin-left: auto;
    }

    .unread-badge {
        padding: 8px 12px;
        min-width: 60px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .unread-badge i {
        font-size: 1rem;
    }

    .unread-count {
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* v163.17f: 모바일 2열 레이아웃 */
        gap: 8px; /* v163.17f: Pinterest 스타일 최소 간격 */
        padding: 8px; /* v163.17f: 양쪽 여백 최소화 */
        /* v163.17r: 시간순 정렬 완전 해결 - 카드 높이 완전 고정 */
        grid-auto-rows: 450px; /* 모든 카드 높이 고정 */
        grid-auto-flow: row; /* 행 우선 배치 (1,2 / 3,4 / 5,6) */
    }
    
    .news-card {
        max-width: none; /* v163.17f: 모바일에서 max-width 제한 제거 */
        border-radius: 8px; /* v163.17f: 모바일 border-radius 최소화 */
        height: 450px; /* v163.17r: 높이 고정으로 시간순 정렬 유지 */
        overflow: hidden; /* 넘치는 내용 숨김 */
    }
    
    .news-content {
        padding: 12px; /* v163.17f: 모바일 카드 내부 여백 최소화 (20px → 12px) */
    }
    
    .news-title {
        font-size: 0.95rem; /* v163.17f: 모바일 제목 크기 축소 */
        margin-bottom: 8px;
    }
    
    .news-description {
        font-size: 0.85rem; /* v163.17f: 모바일 설명 크기 축소 */
        line-height: 1.4;
    }
    
    .main-content {
        padding: 0; /* v163.17f: 모바일 콘텐츠 여백 제거 */
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
}

/* CSS Grid Responsive - 전체 너비 활용 */
@media (min-width: 2560px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (min-width: 1920px) and (max-width: 2559px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (min-width: 1600px) and (max-width: 1919px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .news-card {
        width: calc(33.333% - 16px);  /* 3열 */
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .news-card {
        width: calc(50% - 12px);  /* 2열 */
    }
    
    .page-title {
        font-size: 1.05rem; /* v163.17f: 중간 화면 크기 */
    }
}

@media (max-width: 479px) {
    .news-card {
        width: 100%;  /* 1열 */
    }
    
    .page-title {
        font-size: 0.9rem; /* v163.17f: 매우 작은 화면에서 더 축소 */
    }
    
    .mark-all-read-btn {
        padding: 8px 12px; /* v163.17f: 작은 화면에서 패딩 축소 */
        font-size: 0.85rem;
    }
    
    .unread-badge {
        padding: 6px 10px; /* v163.17f: 작은 화면에서 패딩 축소 */
        font-size: 0.8rem;
    }
}

/* ====================================
   Ad Cards (Google AdSense)
   ==================================== */

.ad-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.ad-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    position: relative;
}

.ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;  /* 왼쪽 상단으로 변경 */
    background: var(--primary-color);  /* 뉴스 소스 배지와 동일한 파란색 */
    color: white;
    padding: 5px 12px;  /* 뉴스 소스 배지와 동일한 패딩 */
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.ad-badge i {
    font-size: 0.9rem;
}

/* AdSense 광고 컨테이너 */
.adsbygoogle {
    display: block;
    width: 100%;
    min-height: 250px;
    background: var(--bg-primary);
}

/* 광고 승인 전 플레이스홀더 - 깔끔한 회색 박스 */
.ad-card .ad-content {
    background: #f5f5f5;
    min-height: 250px;
}

/* 광고가 로드되면 배경 제거 */
.ad-card:has(.adsbygoogle[data-ad-status="filled"]) .ad-content {
    background: transparent;
}
