/* 기본 form-group 스타일 (신문 정보 등) */
.kaice-form-group {
    margin-bottom: 24px;
}/* 기사 입력 폼의 input, textarea 스타일 */
.kaice-articles-section .kaice-form-group input,
.kaice-articles-section .kaice-form-group textarea {
    width: 100% !important;
    padding: 12px !important;
    background-color: #ffffff !important;
    border: 1px solid !important;
    border-color: #E5E5E5 !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    font-family: 'S-CoreDream-3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    transition: border-color 0.2s !important;
    line-height: 1.5 !important;
    resize: vertical !important;
    box-sizing: border-box !important;
}

/* 기사 입력 폼의 select 스타일 - 폰트어썸 아래 화살표 아이콘 */
.kaice-articles-section .kaice-form-group select {
    width: 100% !important;
    padding: 12px !important;
    background-color: #ffffff !important;
    border: 1px solid !important;
    border-color: #E5E5E5 !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    font-family: 'S-CoreDream-3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    transition: border-color 0.2s !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23666" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.kaice-articles-section .kaice-form-group input:focus,
.kaice-articles-section .kaice-form-group textarea:focus,
.kaice-articles-section .kaice-form-group select:focus {
    outline: none;
    border-color: #408090;
    box-shadow: 0 0 0 3px rgba(64, 128, 144, 0.1);
}/* KAICE 신문 빌더 2.0 - 데스크톱 프로그램과 동일한 스타일 */

/* 모든 KAICE 플러그인 입력란에 강력 적용되는 기본 스타일 (폰트어썸 제외) */
.kaice-newspaper-builder input[type="text"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder input[type="email"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder input[type="password"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder input[type="number"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder input[type="date"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder input[type="time"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder input[type="url"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder input[type="search"]:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
.kaice-newspaper-builder textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
#kaice-newspaper-app input:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
#kaice-newspaper-app textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
#kaice-admin-panel input:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
#kaice-admin-panel textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]) {
    background-color: #ffffff !important;
    border: 1px solid !important;
    border-color: #E5E5E5 !important;
    border-radius: 5px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
}

/* 폰트어썸 아이콘에는 Font Awesome 폰트 강제 적용 */
.kaice-newspaper-builder .fa,
.kaice-newspaper-builder .fas,
.kaice-newspaper-builder .far,
.kaice-newspaper-builder .fab,
.kaice-newspaper-builder .fal,
.kaice-newspaper-builder .fad,
.kaice-newspaper-builder [class*="fa-"],
#kaice-newspaper-app .fa,
#kaice-newspaper-app .fas,
#kaice-newspaper-app .far,
#kaice-newspaper-app .fab,
#kaice-newspaper-app .fal,
#kaice-newspaper-app .fad,
#kaice-newspaper-app [class*="fa-"] {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'Font Awesome 5 Free', 'Font Awesome 5 Pro' !important;
}

/* Select 박스 전용 스타일 - 폰트어썸 아래 화살표 아이콘(chevron-down) */
.kaice-newspaper-builder select,
#kaice-newspaper-app select,
#kaice-admin-panel select {
    background-color: #ffffff !important;
    border: 1px solid !important;
    border-color: #E5E5E5 !important;
    border-radius: 5px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23666" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
}

/* 최고 우선순위 - 모든 input, textarea에 전역 적용 (폰트어썸 제외) */
body .kaice-newspaper-builder input:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
body .kaice-newspaper-builder textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
body #kaice-newspaper-app input:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
body #kaice-newspaper-app textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
body #kaice-admin-panel input:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
body #kaice-admin-panel textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
body .kaice-form-group input:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]),
body .kaice-form-group textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]) {
    background-color: #ffffff !important;
    border: 1px solid #E5E5E5 !important;
    border-radius: 5px !important;
}

/* Select 박스 최고 우선순위 - 폰트어썸 아래 화살표 아이콘 */
body .kaice-newspaper-builder select,
body #kaice-newspaper-app select,
body #kaice-admin-panel select,
body .kaice-form-group select {
    font-size: 16px !important;
    font-family: 'S-CoreDream-4', sans-serif !important;
    color: #000!important;
    background-color: #ffffff !important;
    border: 1px solid #E5E5E5 !important;
    border-radius: 5px !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23666" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* 사용자 권한에 따른 예시 텍스트 스타일 */
.kaice-student-examples .example-text {
    opacity: 0.3 !important;
    color: #666 !important;
}

.kaice-admin-examples .example-text {
    opacity: 1 !important;
    color: #000 !important;
}

.user-content {
    opacity: 1 !important;
    color: #000 !important;
}

/* 폰트 정의 */
@font-face {
    font-family: 'S-CoreDream-3';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-3Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'S-CoreDream-4';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-4Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'ChosunBg';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunBg.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'ChosunKm';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunKm.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'ChosunLo';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunLo.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* 전역 스타일 */
* {
    box-sizing: border-box;
}

.kaice-newspaper-builder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

/* 로딩 화면 */
.kaice-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.kaice-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 헤더 */
.kaice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.kaice-header-left {
    display: flex;
    align-items: center;
}

.kaice-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kaice-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kaice-title h1 i {
    color: #408090;
    font-size: 26px;
}

.kaice-title p {
    color: #64748b;
    margin: 0;
    font-size: 16px;
}



/* 버튼 스타일 */
.kaice-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.kaice-btn i {
    font-size: 14px;
    margin-right: 4px;
}

.kaice-btn-primary {
    background: #408090;
    color: white;
}

.kaice-btn-primary:hover:not(:disabled) {
    background: #2d6b77;
}

.kaice-btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.kaice-btn-secondary {
    background: #354550;
    color: white;
    border: 1px solid #354550;
}

.kaice-btn-secondary:hover {
    background: #2a3440;
}

.kaice-btn-outline {
    background: transparent;
    color: #408090;
    border: 1px solid #408090;
}

.kaice-btn-outline:hover:not(:disabled) {
    background: #408090;
    color: white;
}

.kaice-btn-outline:disabled {
    color: #94a3b8;
    border-color: #94a3b8;
    cursor: not-allowed;
}

.kaice-btn-admin {
    background: #555;
    color: white;
}

.kaice-btn-admin:hover:not(:disabled) {
    background: #444;
}

/* 메인 컨테이너 */
.kaice-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 상단 섹션 - 신문 정보와 레이아웃 선택 (2열) */
.kaice-top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 카드 내부 컨텐츠도 2열로 배치 */
.kaice-card-content {
    padding: 20px;
}

/* 신문 정보 카드의 내용 - 데스크톱에서는 세로 배치 */
.kaice-newspaper-info .kaice-card-content {
    display: flex;
    flex-direction: column;
    gap: 5px; /* 20px에서 5px로 줄임 */
}

/* 기본 form-group 스타일 */
.kaice-newspaper-info .kaice-form-group {
    margin-bottom: 0; /* 기본 마진 제거 (간격은 gap으로 처리) */
}

/* 발행일은 전체 너비로 */
.kaice-newspaper-info .kaice-form-group.full-width {
    grid-column: 1 / -1;
}
.kaice-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.kaice-card-header {
    padding: 20px 20px 0 20px;
}

.kaice-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.kaice-card-content {
    padding: 20px;
}

/* 폼 스타일 */
.kaice-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}



.kaice-form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px; /* label과 input 간의 간격 */
    font-size: 14px;
}

.kaice-form-group input,
.kaice-form-group textarea {
    width: 100% !important;
    padding: 12px !important;
    background-color: #ffffff !important;
    border: 1px solid !important;
    border-color: #E5E5E5 !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.2s !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    resize: vertical !important;
    box-sizing: border-box !important;
}

.kaice-form-group select {
    width: 100% !important;
    padding: 12px !important;
    background-color: #ffffff !important;
    border: 1px solid !important;
    border-color: #E5E5E5 !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.2s !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23666" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.kaice-form-group input:focus,
.kaice-form-group textarea:focus,
.kaice-form-group select:focus {
    outline: none;
    border-color: #408090;
    box-shadow: 0 0 0 3px rgba(64, 128, 144, 0.1);
}

/* select 요소는 고정 높이 설정 */
.kaice-form-group select {
    height: 48px;
}

/* 제목 입력란 하단 여백 축소 */
.kaice-articles-section .article-title-input {
    min-height: 60px;
    max-height: 120px;
    margin-bottom: 5px; /* 기본 여백 축소 */
}

/* 제목 입력 전체 form-group의 하단 마진 축소 */
.kaice-articles-section .kaice-form-group {
    margin-bottom: 20px; /* 기본 24px에서 20px로 감소 */
}

/* 마지막 form-group은 마진 제거 */
.kaice-articles-section .kaice-form-group:last-child {
    margin-bottom: 0;
}

/* 레이아웃 선택기 - 가로 2열 배치 */
.kaice-layout-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.kaice-layout-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px; /* 16px에서 20px로 증가 */
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    min-height: 320px; /* 최소 높이 추가 */
    display: flex;
    flex-direction: column;
}

.kaice-layout-card:hover {
    border-color: #408090;
    transform: translateY(-2px);
}

.kaice-layout-card.selected {
    border-color: #408090;
}

.layout-preview {
    margin-bottom: 16px; /* 12px에서 16px로 증가 */
    border-radius: 8px;
    overflow: hidden;
    flex: 1; /* 이미지 영역이 남은 공간을 차지하도록 */
    display: flex;
    align-items: center;
}

.layout-preview-image {
    width: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 8px;
}

.layout-visual {
    height: 80px;
    border-radius: 8px;
    padding: 8px;
}

.visual-grid {
    display: grid;
    gap: 4px;
    height: 100%;
}

.layout-1 .visual-grid {
    grid-template-areas: "main main" "sub1 sub2";
    grid-template-rows: 1fr 0.6fr;
}

.layout-2-grid {
    grid-template-areas: "main main main" "sub1 sub2 sub3";
    grid-template-rows: 1fr 0.6fr;
    grid-template-columns: 1fr 1fr 1fr;
}

.layout-3-grid {
    grid-template-areas: "q1 q2" "q3 q4";
    grid-template-rows: 1fr 1fr;
}



.layout-1 .visual-sub:nth-child(2) { grid-area: sub1; }
.layout-1 .visual-sub:nth-child(3) { grid-area: sub2; }

.layout-2-grid .visual-sub:nth-child(2) { grid-area: sub1; }
.layout-2-grid .visual-sub:nth-child(3) { grid-area: sub2; }
.layout-2-grid .visual-sub:nth-child(4) { grid-area: sub3; }



.layout-3-grid .visual-quarter:nth-child(1) { grid-area: q1; }
.layout-3-grid .visual-quarter:nth-child(2) { grid-area: q2; }
.layout-3-grid .visual-quarter:nth-child(3) { grid-area: q3; }
.layout-3-grid .visual-quarter:nth-child(4) { grid-area: q4; }

.layout-info {
    flex-shrink: 0; /* 정보 영역은 고정 크기 */
}

.layout-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 6px 0; /* 4px에서 6px로 증가 */
}

.layout-info p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 10px 0; /* 8px에서 10px로 증가 */
}

.layout-stats {
    font-size: 12px;
    color: #94a3b8;
}

/* 기사 폼 - 스크롤 제거하고 브라우저 영역 최대 활용 */
.kaice-articles-section {
    height: auto; /* max-height 제거하여 스크롤 제거 */
    overflow: visible; /* 스크롤바 완전 제거 */
    padding-right: 0; /* 스크롤바 여백 제거 */
}

/* 기사 컨테이너 레이아웃 */
.articles-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.article-full-width {
    width: 100%;
}

.article-half-width {
    width: 100%;
}

.kaice-article-form {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    background: white;
}

.article-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
}

.article-form-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

#kaice-admin-panel .article-form-header, #kaice-admin-panel .kaice-newspapers-list {
    padding: 0;
}

.article-status-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-required {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    background: #408090;
    color: white;
}

.article-form-content {
    padding: 20px;
}

/* 처음과 마지막 form-group의 마진 조정 */
.article-form-content .kaice-form-group:last-child {
    margin-bottom: 0; /* 마지막 요소의 하단 마진 제거 */
}

/* 기사 1의 레이아웃별 구조 */

/* 모바일 레이아웃은 기본적으로 숨김 */
.article-mobile-layout {
    display: none;
}

/* 기사 1의 레이아웃을 flex로 변경하여 textarea가 부모 높이에 맞춰지도록 */
.article-layout-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    height: 100%;
}

.article-layout-1 .article-image-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-layout-1 .article-text-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-layout-1 .article-text-section .kaice-form-group:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 기사 1의 내용 textarea가 부모 컨테이너 내에서 최대 높이로 늘어나도록 (차이 카운터 공간 고려) */
.article-layout-1 .article-content-input {
    flex: 1;
    height: calc(100% - 30px); /* char-counter 공간 고려 */
    min-height: 150px; /* 200px에서 150px로 감소 */
    resize: vertical;
}

/* layout-2도 동일하게 flex 구조로 변경 */
.article-layout-2 {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-layout-2 .article-title-section {
    /* 제목 섹션 - 전체 너비 */
}

.article-layout-2 .article-content-image-section {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    align-items: start;
    height: 100%;
    flex: 1;
}

.article-layout-2 .article-content-part {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-layout-2 .article-content-part .kaice-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-layout-2 .article-image-part {
    /* 이미지 부분 */
}

.article-layout-2 .article-content-input {
    flex: 1;
    height: calc(100% - 30px); /* char-counter 공간 고려 */
    min-height: 150px; /* 200px에서 150px로 감소 */
    resize: vertical;
}

/* 반응형: 모바일에서는 데스크톱 레이아웃 숨기고 모바일 레이아웃 표시 */
@media (max-width: 768px) {
    /* 데스크톱 레이아웃 숨김 */
    .article-layout-1,
    .article-layout-2 {
        display: none;
    }
    
    /* 모바일 레이아웃 표시 - [제목] [이미지] [내용] */
    .article-mobile-layout {
        display: block;
    }
}

.char-counter {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    min-height: 16px;
    gap: 8px;
}

/* 상태 메시지가 있을 때만 space-between 사용 */
.char-counter.has-status {
    justify-content: space-between;
}

/* 숫자들을 하나의 그룹으로 묶기 */
.char-counter-numbers {
    display: flex;
    align-items: center;
    gap: 0;
}

.char-status-message {
    font-weight: 500;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
}

.char-counter.over-limit .char-status-message {
    background: #fee2e2;
    color: #dc2626;
}

.char-counter.under-limit .char-status-message {
    background: #fef3c7;
    color: #d97706;
}

.char-counter.good {
    color: #059669;
}

.char-counter .current {
    font-weight: 600;
}

.char-counter.over-limit .current {
    color: #dc2626;
    font-weight: 700;
}

.char-counter.under-limit .current {
    color: #d97706;
}

/* 이미지 업로드 */
.image-upload-area {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload-area:hover {
    border-color: #408090;
}

/* 드래그 앤 드롭 시각적 피드백 */
.image-upload-area.drag-over {
    border-color: #10b981;
    background-color: #ecfdf5;
    border-style: solid;
}

.image-upload-area.drag-over .upload-placeholder {
    color: #059669;
}

.image-upload-area.drag-over .upload-icon {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* 이미지 업로드 영역 비율 설정 */
.aspect-video {
    aspect-ratio: 16/9;
    overflow: hidden; /* 비율 밖으로 나가는 컨텐츠 숨김 */
}

.aspect-square {
    aspect-ratio: 1/1;
    overflow: hidden; /* 비율 밖으로 나가는 컨텐츠 숨김 */
}

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

.upload-icon {
    margin-bottom: 8px;
    opacity: 0.6;
    color: #6b7280;
}

.upload-icon i {
    font-size: 20px;
}

.upload-placeholder p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.upload-placeholder .upload-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.uploaded-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.uploaded-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 16:9 비율 이미지 */
.aspect-video .uploaded-image img {
    aspect-ratio: 16/9;
}

/* 1:1 비율 이미지 */
.aspect-square .uploaded-image img {
    aspect-ratio: 1/1;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.remove-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* 미리보기 스타일 제거 (사용하지 않음) */

/* 사용하지 않는 미리보기 스타일 제거 */

/* 레이아웃별 미리보기 스타일 */
.layout-1-preview .main-article-preview {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ccc;
}

.layout-1-preview .article-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.layout-1-preview .main-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.layout-1-preview .main-content {
    font-size: 10px;
    text-align: justify;
    margin: 0;
}

.layout-1-preview .sub-articles-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.layout-1-preview .sub-title {
    font-size: 12px;
    font-weight: bold;
    margin: 0 0 6px 0;
}

.layout-1-preview .sub-image {
    width: 100%;
    margin-bottom: 6px;
}

.layout-1-preview .sub-content {
    font-size: 9px;
    text-align: justify;
    margin: 0;
}

.layout-2-preview .main-section-preview {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ccc;
}

.layout-2-preview .main-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 12px 0;
}

.layout-2-preview .main-content-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

.layout-2-preview .sub-sections-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.layout-2-preview .sub-section {
    border-right: 1px solid #ddd;
    padding-right: 6px;
}

.layout-2-preview .sub-section:last-child {
    border-right: none;
    padding-right: 0;
}

.layout-3-preview .top-articles-preview,
.layout-3-preview .bottom-articles-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.layout-3-preview .quarter-article {
    border-right: 1px solid #ddd;
    padding-right: 8px;
}

.layout-3-preview .quarter-article:nth-child(even) {
    border-right: none;
    padding-right: 0;
}

.layout-3-preview .quarter-title {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 8px 0;
}

.layout-3-preview .quarter-image {
    width: 100%;
    margin-bottom: 6px;
}

.layout-3-preview .quarter-content {
    font-size: 9px;
    text-align: justify;
    margin: 0;
}

.image-placeholder {
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 1px dashed #d1d5db;
    box-sizing: border-box;
}

/* 16:9 비율 플레이스홀더 */
.aspect-video .image-placeholder {
    aspect-ratio: 16/9;
}

/* 1:1 비율 플레이스홀더 */
.aspect-square .image-placeholder {
    aspect-ratio: 1/1;
}

.image-placeholder.small {
    font-size: 8px;
    min-height: 40px;
}

/* 상태 메시지 - 하단으로 이동 */
.kaice-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

#kaice-status:not([style*="display: none"]) {
    transform: translateX(0);
}

.kaice-status-loading {
    background: #408090;
}

.kaice-status-success {
    background: #408090;
}

.kaice-status-error {
    background: #354550;
}

.kaice-status-info {
    background: #6366f1;
}

.kaice-status-content {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.kaice-status-icon i {
    font-size: 16px;
}

.kaice-download-link {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.kaice-download-link:hover {
    color: #e5e7eb;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .kaice-top-section {
        grid-template-columns: 1fr;
    }
    
    /* 1024px 이하에서 신문 정보 필드들을 2열로 변경 */
    .kaice-newspaper-info .kaice-card-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 16px; /* 세로 갭 0, 가로 갭 16px */
        align-items: start;
    }
}

@media (max-width: 768px) {
    .kaice-newspaper-builder {
        padding: 10px;
    }
    
    .kaice-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .kaice-header-left {
        justify-content: flex-start;
    }
    
    .kaice-actions {
        justify-content: stretch;
        flex-direction: row;
        gap: 8px;
    }
    
    .kaice-btn {
        flex: 1;
        justify-content: center;
    }
    
    /* 768px 이하에서도 신문 정보 필드들을 2열로 유지 */
    .kaice-newspaper-info .kaice-card-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 12px; /* 세로 갭 0, 가로 갭 12px */
        align-items: start;
    }
    
    .kaice-form-row {
        grid-template-columns: 1fr;
    }
    
    /* 모바일에서도 레이아웃 선택지를 2열로 유지 */
    .kaice-layout-selector {
        grid-template-columns: 1fr 1fr;
        gap: 12px; /* 간격을 약간 줄임 */
    }
    
    /* 모바일에서 레이아웃 카드 크기 조정 */
    .kaice-layout-card {
        min-height: 280px; /* 모바일에서는 약간 낮게 */
        padding: 16px; /* 패딩도 약간 줄임 */
    }
    
    .layout-info h4 {
        font-size: 14px; /* 모바일에서 제목 크기 조정 */
    }
    
    .layout-info p {
        font-size: 12px; /* 모바일에서 설명 크기 조정 */
    }
    
    /* 모바일에서 기사 2열 레이아웃도 1열로 변경 */
    .articles-two-column {
        grid-template-columns: 1fr;
    }
    
    .kaice-status {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 12px 16px; /* 모바일에서 패딩 축소 */
        font-size: 14px; /* 폰트 크기 축소 */
    }
}

/* 모바일 반응형 - 이미지 비율 유지 */
@media screen and (max-width: 768px) {
    /* 모바일에서도 정확한 비율 유지 */
    .aspect-square .uploaded-image img {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 1/1 !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .aspect-video .uploaded-image img {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 16/9 !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    /* 업로드 영역 비율 유지 */
    .aspect-square,
    .aspect-video {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 인쇄 스타일 - 브라우저 여백 완전 제거 */
@media print {
    @page {
        size: A4;
        margin: 0;
        orphans: 1;
        widows: 1;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        page-break-inside: avoid !important;
    }
    
    html, body {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: url('newspaper_texture.png') repeat !important;
        background-size: auto !important;
    }
    
    .kaice-newspaper-builder {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }
    
    .kaice-header,
    .kaice-form-section,
    .kaice-status {
        display: none !important;
    }
    
    .kaice-container {
        grid-template-columns: 1fr !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }
    
    .kaice-preview-section {
        position: static !important;
        top: auto !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .kaice-card {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        height: 100% !important;
    }
    
    .kaice-preview-container {
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .newspaper-preview {
        box-shadow: none !important;
        border-radius: 0 !important;
        height: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-inside: avoid !important;
    }
    
    .newspaper-page {
        aspect-ratio: auto !important;
        padding: 0 !important;
        height: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        page-break-inside: avoid !important;
        overflow: hidden !important;
        background: url('newspaper_texture.png') repeat !important;
        background-size: auto !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* newspaper-container - 브라우저 여백 제거, CSS 내부 여백 유지 */
    .newspaper-container {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 12mm 15mm 10mm 15mm !important;
        background: url('newspaper_texture.png') repeat !important;
        background-size: auto !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        z-index: 9999 !important;
    }
}

/* 관리자 모드에서 PDF 버튼 스타일 */
.kaice-admin-mode #kaice-export-pdf-btn:not(:disabled) {
    background: #408090 !important;
}

.kaice-admin-mode #kaice-export-pdf-btn:not(:disabled):hover {
    background: #2d6b77 !important;
}

/* 접근성 개선 */
.kaice-btn:focus,
.kaice-layout-card:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 1px solid #408090;
    outline-offset: 2px;
}

/* PDF 링크 스타일 */
.kaice-pdf-links {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.kaice-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #408090;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.kaice-download-link:hover {
    background: #2d6b77;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.kaice-download-link:active {
    transform: translateY(0);
}

.kaice-download-link i {
    font-size: 16px;
}

/* 상태 메시지 영역의 PDF 링크 특별 스타일 */
.kaice-status-message .kaice-pdf-links {
    justify-content: center;
    margin-top: 15px;
}

.kaice-status-message .kaice-download-link {
    background: rgba(255, 255, 255, 0.9);
    color: #408090;
    border: 1px solid rgba(64, 128, 144, 0.3);
}

.kaice-status-message .kaice-download-link:hover {
    background: white;
    color: #2d6b77;
    border-color: #2d6b77;
}

/* 관리자 모드 전용 스타일 */
.kaice-admin-mode .kaice-title h1 {
    color: #408090;
}

.kaice-admin-mode .kaice-title p {
    color: #64748b;
}

/* 관리자 패널 헤더 스타일 */
.kaice-admin-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kaice-admin-title i {
    color: #408090;
    font-size: 22px;
}

/* 학급 선택과 조회 버튼을 같은 행에 배치 */
.kaice-admin-search-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kaice-admin-search-row select {
    flex: 1;
}

.kaice-admin-search-row .kaice-btn {
    margin-bottom: 0;
    white-space: nowrap;
    height: 48px; /* select와 동일한 높이 */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 20px; /* 좌우 패딩만 설정 */
    flex-shrink: 0; /* 버튼 크기 고정 */
}

/* 학생 목록 그리드 - 버튼 느낌 */
.kaice-students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 0;
}

/* 학생 목록이 빈 상태일 때는 그리드가 아닌 일반 div */
.kaice-students-list.empty {
    display: flex; /* grid가 아닌 flex */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}

.kaice-student-card {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 100px; /* 아이콘 제거로 높이 감소 */
    justify-content: center;
}

.kaice-student-card:hover {
    border-color: #408090!important;
    transform: translateY(-2px);
}

.kaice-student-card.selected {
    background: #408090;
    color: white;
    border-color: #408090;
}

/* 아이콘 관련 스타일 제거 */

.kaice-student-card strong {
    font-size: 16px;
    font-weight: 600;
}

.kaice-student-card small {
    font-size: 12px;
    opacity: 0.8;
}

/* 신문 목록 - 리스트 느낌 */
.kaice-newspapers-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

/* 신문 목록과 학생 목록 로딩 상태 - 최고 우선순위 */
.kaice-newspapers-list.loading,
.kaice-students-list.loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important; /* 아이콘과 텍스트 사이 간격 */
    padding: 40px !important;
    text-align: center !important;
    color: #64748b !important;
    font-size: 16px !important;
    grid-template-columns: none !important; /* 그리드 속성 강제 제거 */
    flex-direction: row !important; /* 가로 배치 강제 */
}

.kaice-newspapers-list.loading i,
.kaice-students-list.loading i {
    font-size: 18px !important;
    color: #408090 !important;
    margin: 0 !important; /* 기존 마진 제거 */
}

/* 빈 상태 스타일 */
.kaice-newspapers-list.empty,
.kaice-students-list.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}

.kaice-newspapers-list.empty i,
.kaice-students-list.empty i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

/* 경고 아이콘 색상 (오류 상태일 때) */
.kaice-newspapers-list.empty i.fa-exclamation-triangle,
.kaice-students-list.empty i.fa-exclamation-triangle {
    color: #f59e0b;
}

.kaice-newspapers-list.empty h4,
.kaice-students-list.empty h4 {
    font-size: 18px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 8px 0;
}

.kaice-newspapers-list.empty p,
.kaice-students-list.empty p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 4px 0;
}

.kaice-newspapers-list.empty small,
.kaice-students-list.empty small {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.kaice-newspaper-card {
    background: white;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: -1px; /* 중복된 border 제거 */
}

.kaice-newspaper-card:first-child {
    border-top: 1px solid #e5e5e5;
}

.kaice-newspaper-card:last-child {
    border-bottom: 1px solid #e5e5e5;
}

.kaice-newspaper-card:hover {
    border-color: #408090;
    z-index: 1;
    position: relative;
}

.kaice-newspaper-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kaice-newspaper-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
    line-height: 1.3;
}

.kaice-newspaper-meta {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.kaice-newspaper-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    align-self: flex-end;
}

/* 버튼 크기 조정 */
.kaice-newspaper-actions .kaice-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 80px;
    justify-content: center;
}

/* 성공/정보/위험 버튼 색상 - [kaice_newspaper]의 PDF 버튼 색상과 동일하게 */
.kaice-btn-success {
    background: #408090;
    color: white;
}

.kaice-btn-success:hover {
    background: #2d6b77;
}

.kaice-btn-info {
    background: #354550;
    color: white;
}

.kaice-btn-info:hover {
    background: #2a3440;
}

.kaice-btn-danger {
    background: #555;
    color: white;
}

.kaice-btn-danger:hover {
    background: #444;
}

/* 폼 컨트롤 통일 - 관리자 모드와 일반 모드 select 박스 - 폰트어썸 아래 화살표 */
.kaice-form-control,
.kaice-admin-search-row select {
    width: 100% !important;
    padding: 12px !important;
    background-color: #ffffff !important;
    border: 1px solid !important;
    border-color: #E5E5E5 !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.2s !important;
    font-family: inherit !important;
    height: 48px !important;
    box-sizing: border-box !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23666" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.kaice-form-control:focus,
.kaice-form-group select:focus,
.kaice-admin-search-row select:focus {
    outline: none;
    border-color: #408090;
    box-shadow: 0 0 0 3px rgba(64, 128, 144, 0.1);
}

/* 관리자 모드 반응형 */
@media (max-width: 768px) {
    .kaice-admin-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .kaice-admin-search-row .kaice-btn {
        align-self: stretch;
        margin-top: 0;
    }
    
    .kaice-students-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .kaice-student-card {
        padding: 16px;
        min-height: 80px; /* 모바일에서 더 작게 */
    }
    
    /* 모바일에서 로딩 상태 조정 */
    .kaice-newspapers-list.loading,
    .kaice-students-list.loading {
        padding: 30px 15px;
        font-size: 14px;
        gap: 10px;
    }
    
    .kaice-newspapers-list.loading i,
    .kaice-students-list.loading i {
        font-size: 16px;
    }
    
    .kaice-student-card strong {
        font-size: 14px;
    }
    
    .kaice-newspaper-card {
        flex-direction: column;
        gap: 12px;
    }
    
    /* 모바일에서 kaice-newspaper-actions를 kaice-newspaper-title h2 위에 배치 */
    .kaice-newspaper-title {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .kaice-newspaper-title h2 {
        order: 2 !important; /* h2 제목을 두 번째로 */
    }
    
    .kaice-newspaper-actions {
        order: 1 !important; /* 액션 버튼을 첫 번째로 */
        align-self: stretch;
        justify-content: space-between;
        margin-bottom: 12px !important; /* 액션과 제목 사이 간격 */
    }
    
    .kaice-newspaper-actions .kaice-btn {
        flex: 1;
        min-width: auto;
    }
    
    .kaice-admin-title {
        font-size: 20px;
        text-align: center;
    }
    
    .kaice-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .kaice-header-left {
        justify-content: center;
    }
}

/* 이미지 업로드 진행 상태 */
.image-upload-area.uploading {
    background: #fff!important;
    border-color: #2196f3;
    animation: uploadPulse 2s infinite;
}

.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
    height: 100%;
}

.upload-progress .upload-icon {
    font-size: 32px;
    opacity: 0.8;
}

.upload-progress p {
    margin: 0;
    font-weight: 500;
    font-size: 16px;
}

.upload-progress .upload-hint {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 12px;
    margin: 0;
}

@keyframes uploadPulse {
    0%, 100% {
        background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
        transform: scale(1);
    }
    50% {
        background: linear-gradient(135deg, #bbdefb 0%, #e1bee7 100%);
        transform: scale(1.02);
    }
}

/* 다크 모드 지원 (추후 구현용) */
@media (prefers-color-scheme: dark) {
    /* 다크 모드 스타일은 필요시 추가 */
}