/* 기본 리셋 및 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* style.css 수정 및 추가 */

:root {
    /* 눈이 편한 '전문 뉴스' 컬러 팔레트 (네이비/그레이 톤) */
    --primary-color: #00376b; /* 신뢰감 있는 네이비 */
    --primary-dark: #00254a;
    --secondary-color: #5f6368;
    --success-color: #1e8e3e;
    --warning-color: #f9ab00;
    --danger-color: #d93025;
    --dark-color: #202124;
    --light-gray: #f1f3f4; /* 눈이 편안한 배경색 */
    --border-color: #dadce0;
    --text-primary: #202124; /* 완전 검정보다 눈이 편한 진한 회색 */
    --text-secondary: #5f6368;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

/* 프로필 드롭다운 텍스트 색상 수정 (요청사항) */
.profile-details h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #000000 !important; /* 강제 검정색 지정 */
    font-weight: 700;
}

/* 설정 메뉴 버튼 디자인 변경 (눈 아픈 색상 제거) */
#settingsSection .btn-block {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    justify-content: flex-start; /* 왼쪽 정렬 */
    padding: 14px;
    box-shadow: none;
}

#settingsSection .btn-block:active {
    background: var(--light-gray);
    transform: scale(0.99);
}

#settingsSection .btn-block i {
    color: var(--primary-color); /* 아이콘에만 포인트 컬러 */
    width: 24px;
    text-align: center;
    margin-right: 10px;
}

/* 팝업 스타일 추가 */
.main-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.main-popup {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: popupPop 0.3s ease;
}

@keyframes popupPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-body {
    padding: 24px;
    text-align: center;
}

.popup-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.popup-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.popup-footer {
    display: flex;
    border-top: 1px solid var(--border-color);
}

.popup-btn {
    flex: 1;
    padding: 14px;
    border: none;
    background: white;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.popup-btn.dont-show {
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);
}

.popup-btn.close {
    color: var(--primary-color);
    font-weight: 700;
}

/* 관리자용 패치노트 버튼 */
.admin-patch-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--light-gray);
    color: var(--text-primary);
    padding-bottom: 70px;
    overflow-x: hidden;
}

/* 전역 여백 제거 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    max-width: 100%;
}

.logo-section {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.money-display {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.money-display:active {
    background: rgba(255,255,255,0.3);
    transform: scale(0.95);
}

.money-display i {
    font-size: 14px;
    color: #ffd700;
}

/* ===== 2. 로고 크기 줄이기 ===== */
.logo {
    font-size: 20px; /* ✅ 22px → 20px */
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.5px;
}

.logo-sub {
    font-size: 9px; /* ✅ 10px → 9px */
    opacity: 0.9;
    margin-top: 2px;
}

/* ===== 3. 프로필 버튼 크기 줄이기 ===== */
.profile-btn {
    width: 36px; /* ✅ 40px → 36px */
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    font-size: 18px; /* ✅ 20px → 18px */
    cursor: pointer;
    transition: all 0.3s;
}

.profile-btn:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.3);
}

/* 프로필 드롭다운 */
.profile-dropdown {
    position: absolute;
    top: 56px; /* 헤더 높이에 맞춤 */
    right: 0;
    width: 100%;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 999;
}

.profile-dropdown.active {
    max-height: 300px;
    border-bottom: 1px solid var(--border-color);
}

#profileDropdownContent {
    padding: 16px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 12px;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.profile-details h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.profile-details p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* 하단 네비게이션 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn i {
    font-size: 20px;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* 메인 컨텐츠 여백 조정 */
.main-content {
    padding-top: 70px;
    padding-bottom: 80px;
    min-height: calc(100vh - 150px);
}

.page-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 7. 섹션 헤더 여백 줄이기 ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px; /* ✅ 20px → 16px */
}

.section-header h2 {
    flex: 1;
    font-size: 18px; /* ✅ 20px → 18px */
    font-weight: 700;
    margin: 0;
}

.btn-back {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:active {
    transform: scale(0.95);
    background: var(--border-color);
}

/* ===== 5. 검색바 여백 줄이기 ===== */
.search-bar {
    background: white;
    border-radius: 12px;
    padding: 10px; /* ✅ 12px → 10px */
    margin-bottom: 10px; /* ✅ 12px → 10px */
    box-shadow: var(--shadow);
}

.search-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.search-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:active {
    background: var(--primary-dark);
    transform: scale(0.95);
}

/* ===== 6. 정렬 칩 여백 줄이기 ===== */
.sort-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 12px; /* ✅ 16px → 12px */
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.sort-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chip:active {
    transform: scale(0.95);
}

/* 기사 카드 */
.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.article-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-hover);
}

.article-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--border-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 48px;
}

.article-content {
    padding: 16px;
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.vip-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
}

.article-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.article-stats {
    display: flex;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-actions {
    display: flex;
    gap: 8px;
}

/* 버튼 스타일 */
.btn-primary, .btn-secondary, .btn-success, .btn-info, .btn-warning, .btn-danger, .btn-dark {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-secondary { background: white; color: var(--primary-color); border: 2px solid var(--primary-color); }
.btn-success { background: var(--success-color); color: white; }
.btn-info { background: var(--secondary-color); color: white; }
.btn-warning { background: var(--warning-color); color: #000; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-dark { background: var(--dark-color); color: white; }

.btn-primary:active { background: var(--primary-dark); transform: scale(0.95); }
.btn-secondary:active { background: var(--primary-color); color: white; transform: scale(0.95); }
.btn-success:active { background: #218838; transform: scale(0.95); }
.btn-info:active { background: #1565c0; transform: scale(0.95); }
.btn-dark:active { background: #23272b; transform: scale(0.95); }

.btn-block {
    width: 100%;
    margin-bottom: 12px;
}

/* 폼 스타일 */
.write-form, .settings-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: var(--light-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload-area:active {
    border-color: var(--primary-color);
    background: white;
}

.image-upload-area i {
    font-size: 40px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.image-preview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

.warning-box {
    display: none;
    background: #fff0f0;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
}

/* 프로필 카드 */
.profile-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.profile-card h4 {
    margin: 0 0 12px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.profile-card p {
    margin: 8px 0;
    font-size: 14px;
}

/* 토글 스위치 */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    position: relative;
    transition: all 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::after {
    left: 26px;
}

.toggle-text {
    flex: 1;
}

.toggle-text strong {
    display: block;
    margin-bottom: 4px;
}

.toggle-text small {
    color: var(--text-secondary);
    font-size: 12px;
}

/* 설정 구분선 */
.settings-divider {
    height: 1px;
    background: var(--border-color);
    margin: 30px 0;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* 관리자 액션 버튼 */
.admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-event-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.event-card {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.event-card:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-hover);
}

.event-card i {
    font-size: 32px;
    color: var(--primary-color);
}

.event-card span {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* 사용자 카드 */
.user-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.user-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.user-info {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-actions button {
    padding: 6px 12px;
    font-size: 11px;
}

/* 댓글 섹션 */
.comments-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.comments-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.comment-card {
    background: var(--light-gray);
    border-left: 3px solid var(--primary-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 13px;
}

.comment-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.comment-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.comment-submit-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-submit-btn:active {
    background: var(--primary-dark);
    transform: scale(0.95);
}

/* 투표 버튼 */
.vote-btn {
    padding: 10px 16px;
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vote-btn:active {
    transform: scale(0.95);
}

.vote-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.vote-btn.dislike.active {
    background: var(--dark-color);
    border-color: var(--dark-color);
}

/* 더보기 버튼 */
.load-more {
    text-align: center;
    margin: 20px 0;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light-gray);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:active {
    background: var(--border-color);
    transform: scale(0.95);
}

.modal form, .modal > div:not(.modal-header) {
    padding: 20px;
}

/* 탭 버튼 */
.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-btn:active {
    transform: scale(0.95);
}

/* 정보 텍스트 */
.info-text {
    background: var(--light-gray);
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* QnA 카드 */
.qna-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.qna-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qna-body {
    padding: 16px;
}

.q-part {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.a-part {
    font-size: 14px;
    background: var(--light-gray);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    line-height: 1.6;
}

/* 광고 배너 */
.ad-banner {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.ad-badge {
    display: inline-block;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* 고정 배지 */
.pinned-badge {
    display: inline-block;
    background: #ffd700;
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
}

/* 스크롤바 스타일 (웹킷) */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 점검 모드 스타일 */
.maintenance-overlay {
    display: none; /* 기본 숨김 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #202124; /* 어두운 배경 */
    z-index: 99999; /* 최상위 */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.maintenance-box {
    background: white;
    width: 100%;
    max-width: 500px;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    animation: popupPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.maintenance-icon {
    width: 80px;
    height: 80px;
    background: #e8f0fe;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}

.maintenance-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.maintenance-img-wrapper img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.maintenance-message {
    font-size: 16px;
    line-height: 1.6;
    color: #5f6368;
    margin-bottom: 20px;
    white-space: pre-wrap; /* 줄바꿈 적용 */
}

.maintenance-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    color: #9aa0a6;
    font-size: 13px;
}

/* 관리자 버튼 그리드 조정 */
.admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* 더보기 메뉴 그리드 */
.more-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.more-card {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.more-card:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-hover);
}

.more-card i {
    font-size: 32px;
    color: var(--primary-color);
}

.more-card span {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* 알림 뱃지 */
.notification-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #dc3545;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* 메신저 필터 */
.messenger-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.messenger-filters::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-chip:active {
    transform: scale(0.95);
}

/* 알림 카드 */
.notification-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    align-items: start;
    transition: all 0.2s;
    position: relative;
}

.notification-card.unread {
    background: #f0f7ff;
    border-left: 4px solid var(--primary-color);
}

.notification-card:active {
    transform: scale(0.98);
}

.notification-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text-primary);
}

.notification-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.notification-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 20px;
    right: 16px;
}

.btn-text {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-text:active {
    opacity: 0.7;
}

/* 캐치마인드 게임 스타일 */
.catchmind-start-screen {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.catchmind-game-screen {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.catchmind-image {
    width: 100%;
    max-width: 400px;
    height: 300px;
    object-fit: contain;
    background: var(--light-gray);
    border-radius: 8px;
    margin: 20px auto;
    display: block;
}

.timer-display {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-color);
    margin: 20px 0;
}

.timer-display.warning {
    color: var(--danger-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hint-list {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: left;
}

.hint-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.hint-item:last-child {
    border-bottom: none;
}

.answer-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.difficulty-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.difficulty-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.difficulty-btn.easy {
    border-color: #4caf50;
    color: #4caf50;
}

.difficulty-btn.medium {
    border-color: #ff9800;
    color: #ff9800;
}

.difficulty-btn.hard {
    border-color: #f44336;
    color: #f44336;
}

.difficulty-btn.active {
    color: white;
}

.difficulty-btn.easy.active {
    background: #4caf50;
}

.difficulty-btn.medium.active {
    background: #ff9800;
}

.difficulty-btn.hard.active {
    background: #f44336;
}

.game-result-screen {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.result-image {
    width: 100%;
    max-width: 300px;
    height: 225px;
    object-fit: contain;
    background: var(--light-gray);
    border-radius: 8px;
    margin: 20px auto;
    display: block;
}

.correct-answer {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    margin: 20px 0;
}

.reward-display {
    font-size: 28px;
    font-weight: 900;
    color: #ffd700;
    margin: 15px 0;
}

/* 쿠폰 스타일 */
.coupon-input-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.coupon-input-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--primary-color);
}

.coupon-input-wrapper {
    display: flex;
    gap: 8px;
}

.coupon-history-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--success-color);
}

.coupon-code {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 8px;
}

.coupon-reward {
    color: #ffd700;
    font-weight: 900;
    font-size: 18px;
}

.event-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* 인벤토리 아이템 카드 호버 효과 */
.inventory-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 탭 버튼 스타일 */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #5f6368;
}

.tab-btn:hover {
    border-color: #c62828;
    color: #c62828;
}

.tab-btn.active {
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    color: white;
    border-color: #c41e3a;
}

/* ===== 대댓글 및 댓글 스타일 개선 ===== */

.comment-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

.comment-time {
    font-size: 11px;
    color: #888;
}

.comment-body {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.comment-footer {
    display: flex;
    gap: 10px;
    font-size: 12px;
}

.btn-text {
    background: none;
    border: none;
    padding: 0;
    color: #666;
    cursor: pointer;
    font-size: 12px;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-text.text-danger {
    color: #d93025;
}

.btn-text-danger {
    background: none;
    border: none;
    padding: 0;
    color: #d93025;
    cursor: pointer;
    font-size: 11px;
}

/* 대댓글 컨테이너 */
.replies-container {
    margin-top: 10px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 2px solid #eee;
}

.reply-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 12px;
}

.reply-author {
    font-weight: 600;
    color: #555;
}

.reply-time {
    font-size: 10px;
    color: #999;
}

.reply-content {
    font-size: 13px;
    color: #333;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.reply-actions {
    text-align: right;
    margin-top: 4px;
}

/* 답글 입력창 */
.reply-input-area {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    background: #f1f3f4;
    padding: 8px;
    border-radius: 8px;
}

.reply-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 13px;
}

.btn-reply-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 36px;
    cursor: pointer;
}

/* ===== 페이지 섹션 상단 여백 증가 ===== */
.page-section {
    padding-top: 10px !important; /* 기존보다 증가 */
    padding-bottom: 100px;
    min-height: calc(100vh - 120px);
}

/* 더보기 메뉴 특별 처리 */
#moreMenuSection {
    padding-top: 10px !important;
}

/* 설정 섹션 */
#settingsSection {
    padding-top: 10px !important;
    padding-bottom: 120px;
}

/* 사용자 관리 섹션 */
#userManagementSection {
    padding-top: 10px !important;
    padding-bottom: 140px;
}

/* 기사 상세 섹션 */
#articleDetailSection {
    padding-top: 10px !important;
    padding-bottom: 120px;
}

/* 메신저 섹션 */
#messengerSection {
    padding-top: 10px !important;
}

/* 이벤트 메뉴 */
#eventMenuSection {
    padding-top: 10px !important;
}

/* 인벤토리 */
#inventorySection {
    padding-top: 10px !important;
}

/* 상점 */
#storeSection {
    padding-top: 10px !important;
}

/* 헤더 고정 시 본문 여백 */
body {
    padding-top: 70px; /* 헤더 높이만큼 */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* ===== 주식 시스템 스타일 ===== */

.stock-tab {
    transition: all 0.3s ease;
}

.stock-tab:hover {
    background: #f8f9fa !important;
}

/* 모달 스타일 개선 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #212529;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #c62828;
}

/* 버튼 스타일 */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-info {
    background: #2196f3;
    color: white;
}

.btn-info:hover {
    background: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* 로딩 스피너 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #c62828;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* ===== 댓글 섹션 스타일 개선 ===== */

.comments-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 24px;
}

.comments-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #202124;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 댓글 카드 */
.comment-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 4px solid #00376b;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.comment-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-author {
    font-weight: 700;
    color: #00376b;
    font-size: 14px;
    flex: 1;
}

.comment-time {
    font-size: 12px;
    color: #6c757d;
}

.comment-body {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.comment-footer {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.btn-text {
    background: none;
    border: none;
    padding: 0;
    color: #6c757d;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-text:hover {
    color: #00376b;
    text-decoration: underline;
}

.btn-text.text-danger {
    color: #dc3545;
}

.btn-text.text-danger:hover {
    color: #c82333;
}

/* 대댓글 컨테이너 */
.replies-container {
    margin-top: 16px;
    padding-left: 16px;
    border-left: 3px solid #dee2e6;
}

.reply-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.reply-author {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}

.reply-time {
    font-size: 11px;
    color: #868e96;
    margin-left: auto;
}

.reply-content {
    font-size: 13px;
    color: #333;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.reply-actions {
    text-align: right;
    margin-top: 8px;
}

.btn-text-danger {
    background: none;
    border: none;
    padding: 0;
    color: #dc3545;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.btn-text-danger:hover {
    color: #c82333;
    text-decoration: underline;
}

/* 답글 입력 영역 */
.reply-input-area {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.reply-input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}

.reply-input:focus {
    outline: none;
    border-color: #00376b;
    box-shadow: 0 0 0 3px rgba(0, 55, 107, 0.1);
}

.btn-reply-submit {
    background: #00376b;
    color: white;
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-reply-submit:hover {
    background: #00254a;
}

.btn-reply-submit:active {
    transform: scale(0.95);
}

/* 댓글 입력 영역 */
.comment-input-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.comment-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: #00376b;
    box-shadow: 0 0 0 3px rgba(0, 55, 107, 0.1);
}

.comment-input::placeholder {
    color: #adb5bd;
}

.comment-submit-btn {
    width: 52px;
    height: 52px;
    border: none;
    background: #00376b;
    color: white;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-submit-btn:hover {
    background: #00254a;
}

.comment-submit-btn:active {
    background: #001f3f;
    transform: scale(0.95);
}

/* 더보기 버튼 */
.load-more {
    text-align: center;
    margin: 20px 0;
}

.load-more button {
    padding: 12px 24px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more button:hover {
    background: #f8f9fa;
    border-color: #00376b;
    color: #00376b;
}

/* 빈 상태 */
.comments-section p {
    text-align: center;
    padding: 40px 20px;
    color: #868e96;
    font-size: 15px;
}

/* 반응형 */
@media (max-width: 768px) {
    .comments-section {
        padding: 16px;
    }
    
    .comment-card {
        padding: 12px;
    }
    
    .reply-input-area {
        padding: 8px;
    }
    
    .comment-input-wrapper {
        gap: 8px;
    }
    
    .comment-submit-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}
/* ✅ Placeholder 스타일 - 비어있을 때만 표시 */
    #quillEditor .ql-editor.ql-blank::before {
        content: attr(data-placeholder) !important;
        color: #adb5bd !important;
        font-style: italic;
        position: absolute;
        left: 16px;
        right: 16px;
        top: 16px;
        pointer-events: none;
        opacity: 1;
        z-index: 1;
        white-space: pre-wrap;
    }

    /* ✅ 내용이 조금이라도 있으면 placeholder 완전히 숨김 */
    #quillEditor .ql-editor:not(.ql-blank)::before {
        content: '' !important;
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    /* ✅ 포커스 + 내용 있을 때 placeholder 숨김 */
    #quillEditor .ql-editor:focus:not(.ql-blank)::before {
        display: none !important;
        visibility: hidden !important;
    }

    /* ✅ 에디터 본문의 실제 내용이 placeholder 위에 표시되도록 */
    #quillEditor .ql-editor > * {
        position: relative;
        z-index: 2;
    }

    /* ========== 점검모드 애니메이션 ========== */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* 점검모드 화면 스타일 */
#maintenanceScreen {
    font-family: 'Noto Sans KR', sans-serif;
}

#maintenanceScreen h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 점검모드 관리 모달 이미지 업로드 */
#maintenanceModeModal .image-upload-area {
    border: 2px dashed #ddd;
    padding: 30px;
    border-radius: 8px;
    cursor: pointer;
    background: #f8f9fa;
    text-align: center;
    transition: all 0.3s;
}

#maintenanceModeModal .image-upload-area:hover {
    border-color: #c62828;
    background: #fff;
}

#maintenanceModeModal .image-preview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}
