/* ============================================
   홈 페이지 (Welcome Section)
   ============================================ */
.welcome-section {
    text-align: center;
    padding: 5rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 3rem auto;  /* ✅ auto로 가운데 정렬 */
    max-width: 800px;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-section p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.welcome-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.welcome-actions .btn {
    min-width: 180px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.welcome-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 애니메이션 효과 */
.welcome-section {
    animation: fadeInUp 0.6s ease;
}

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

/* 반응형 */
@media (max-width: 768px) {
    .welcome-section {
        padding: 3rem 1.5rem;
        margin: 2rem auto;
    }

    .welcome-section h2 {
        font-size: 2rem;
    }

    .welcome-section p {
        font-size: 1.1rem;
    }

    .welcome-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .welcome-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .welcome-section {
        padding: 2rem 1rem;
        margin: 1rem auto;
    }

    .welcome-section h2 {
        font-size: 1.75rem;
    }

    .welcome-section p {
        font-size: 1rem;
    }
}

/* ============================================
   로그인 페이지
   ============================================ */
.login-container {
    max-width: 450px;
    margin: 4rem auto;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #333;
    font-size: 2rem;
}

.login-form .form-group {
    margin-bottom: 1.8rem;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.login-form .form-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.login-form .btn-block {
    width: 100%;
    padding: 1.1rem;
    margin-top: 0.5rem;
}

.login-container .auth-switch,
.register-container .auth-link,
.auth-link {
    text-align: center;
    margin-top: 2rem;
    color: #666;
    font-size: 0.95rem;
}

.login-container .auth-switch a,
.register-container .auth-link a,
.auth-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.login-container .auth-switch a:hover,
.register-container .auth-link a:hover,
.auth-link a:hover {
    text-decoration: underline;
}

/* ============================================
   회원가입 페이지
   ============================================ */

/* 컨테이너 */
.register-container {
    max-width: 750px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.register-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.75rem;
}

/* 폼 레이아웃 */
.register-form-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    max-width: 100%;
    margin: 0 auto;
}

/* ============================================
   프로필 섹션
   ============================================ */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

/* 프로필 이미지 업로드 */
.profile-image-upload {
    width: fit-content; 
    display: flex;
    justify-content: center; 
    position: relative; 
    margin-bottom: 0;
}

.profile-image-preview {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
    background: #f8f9fa;
    position: relative;
}

.profile-image-preview:hover {
    border-color: #007bff;
    background: #e7f3ff;
    transform: scale(1.05);
}

.profile-image-preview.required-highlight {
    border-color: #dc3545;
    border-width: 3px;
    animation: shake 0.5s;
}

.profile-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 0.3s ease;
}

/* 기본 프로필 아이콘 */
.default-profile-icon {
    text-align: center;
    color: #999;
}

.default-profile-icon span {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.1rem;
}

.default-profile-icon p {
    font-size: 0.85rem;
    margin: 0;
}

.default-profile-icon small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #aaa;
}

/* 프로필 이미지 삭제 버튼 */
.profile-remove-btn {
    position: absolute;
    top: -5px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #dc3545;
    color: white;
    border: 2px solid white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-image-upload:hover .profile-remove-btn {
    opacity: 1;
}

.profile-remove-btn:hover {
    background-color: #c82333;
    transform: scale(1.15);
}

/* 프로필 이미지 에러 메시지 */
.profile-section > .form-message {
    width: 100%;
    text-align: center;
    margin-bottom: 0.1rem;
    min-height: 20px;
}

.profile-section > .form-message #profileImageError {
    display: block;
    white-space: nowrap;
    overflow: visible;
    text-align: center;
}

/* 닉네임 필드 */
.profile-section .form-group {
    width: 100%;
    margin-top: 0.2rem;
}

.profile-section .form-group .form-message {
    text-align: left;
}

/* ============================================
   자격 증명 섹션 (이메일, 비밀번호)
   ============================================ */
.credentials-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   폼 푸터 (제출 버튼, 링크)
   ============================================ */
.register-container .form-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    width: 100%;
}

.register-container .form-footer .btn {
    min-width: 300px;
    padding: 0.85rem 2.5rem;
}

.register-container .form-footer .auth-link {
    text-align: center;
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.register-container .form-footer .auth-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.register-container .form-footer .auth-link a:hover {
    text-decoration: underline;
}

/* ============================================
   애니메이션
   ============================================ */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 768px) {
    .register-container {
        max-width: 100%;
        padding: 1rem;
    }

    .register-form-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .profile-section {
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }

    .credentials-section {
        max-width: 100%;
    }

    .register-container .form-footer .btn {
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }
}

/* ============================================
   게시글 목록
   ============================================ */

/* 그리드 레이아웃 */
.post-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

/* 게시글 카드 기본 스타일 */
.post-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 280px;
    position: relative;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 이미지가 있는 카드 */
.post-card-image {
    position: relative;
}

.post-thumbnail {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: white;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-error {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 텍스트 카드 (이미지 없는 경우) */
.post-card-text {
    position: relative;
    background: white;
}

/* 좌상단 텍스트 */
.post-text-box {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    max-height: 180px;
}

/* 오버레이 (검정 그라디언트) */
.post-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 12px;
    color: white;
}

/* 작은 헤더 */
.post-header-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.author-avatar-tiny {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar-tiny.default-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    color: white;
}

.author-nickname-small {
    font-size: 13px;
    font-weight: 500;
    color: white;
}

/* 제목 */
.post-title-compact {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 통계 */
.post-stats-compact {
    display: flex;
    gap: 12px;
    font-size: 12px;
    margin-top: auto;
    color: rgba(255, 255, 255, 0.9);
}

.post-stats-compact span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 기존 스타일 유지 */
.page-info {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #666;
}

.end-message {
    text-align: center;
    padding: 2rem 0;
    margin: 2rem 0;
    color: #7f8c8d;
    font-size: 0.95rem;
    border-top: 1px solid #ecf0f1;
}

.end-message p {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    font-size: 1.1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 목록 컨트롤 (게시글 개수 + 정렬) */
.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    min-height: 40px;
}

.page-info {
    color: #666;
    font-size: 0.95rem;
    display: flex;
    align-items: center; /* ✅ 수직 가운데 정렬 */
    margin: 0; /* ✅ 기본 마진 제거 */
}

.page-info span {
    line-height: 1;
    margin: 0; /* ✅ 마진 제거 */
}

/* 정렬 드롭다운 */
.sort-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.sort-select {
    padding: 0.4rem 2.5rem 0.4rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    height: 32px;
    line-height: 1;
    vertical-align: middle; /* ✅ 텍스트 수직 정렬 */
}

.sort-select:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.sort-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* ✅ 드롭다운 옵션이 아래로 나오도록 강제 */
.sort-select option {
    background: white;
    color: #333;
}

/* 반응형 */
@media (max-width: 768px) {
    .list-controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        min-height: auto;
    }
    
    .sort-select {
        width: 100%;
    }
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .post-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .post-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .post-card {
        height: 240px;
    }

    .post-title-compact {
        font-size: 14px;
    }

    .post-text-box {
        font-size: 12px;
        padding: 10px 12px;
        -webkit-line-clamp: 6;
        max-height: 140px;
    }
}

@media (max-width: 480px) {
    .post-list {
        grid-template-columns: 1fr;
    }

    .post-card {
        height: 200px;
    }

    .post-text-box {
        -webkit-line-clamp: 5;
        max-height: 120px;
    }
}

/* ============================================
   게시글 상세
   ============================================ */
.post-detail-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

.post-detail-header {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.post-detail-header h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.post-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-name {
    font-weight: 600;
    color: #2c3e50;
}

.post-date-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: right;
}

.post-detail-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #666;
}

.post-detail-content {
    padding-top: 0;
    padding-bottom: 1rem;
    line-height: 1.8;
    color: #333;
    font-size: 1.1rem;
}

.post-detail-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.post-detail-content .image-wrapper {
    position: relative;
    display: inline-block;
    margin: 10px 0;
    max-width: 100%;
}

.post-detail-content .image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content-image {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.post-content-image:hover {
    transform: scale(1.02);
}

.post-interactions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin: 1.5rem 0;
}

.btn-interaction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-interaction:hover {
    background: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-2px);
}

.btn-interaction .icon {
    font-size: 1.2rem;
}

.btn-interaction:active {
    transform: translateY(0);
}

.liked-animation {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.post-detail-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.action-buttons-right {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-buttons-center {
    display: flex;
    justify-content: center;
}

/* 댓글 섹션 */
#commentSection {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.comment-write-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.comment-write-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #007bff;
}

.comment-form button {
    align-self: flex-end;
}

.comments-list {
    margin-top: 2rem;
}

.comments-list h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: #333;
}

.no-comments {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1rem;
}

.comment-item {
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #fff;
    transition: box-shadow 0.3s;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 0.85rem;
    color: #999;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-buttons {
    display: inline-flex;
    gap: 0.25rem;
}

.btn-edit-comment,
.btn-delete-comment {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-edit-comment {
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-edit-comment:hover {
    background: #007bff;
    color: white;
}

.btn-delete-comment {
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-delete-comment:hover {
    background: #dc3545;
    color: white;
}

.comment-body {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-edit-form {
    margin-top: 0.5rem;
}

.comment-edit-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
    min-height: 80px;
}

.comment-edit-textarea:focus {
    outline: none;
    border-color: #007bff;
}

.comment-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}

/* ============================================
   회원정보 수정
   ============================================ */
.profile-edit-container {
    max-width: 450px;
    margin: 4rem auto;
    padding: 2rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-edit-container h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #333;
    font-size: 2rem;
}

/* 프로필 이미지 섹션 */
.profile-edit-image {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.profile-edit-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    transition: all 0.3s;
}

.profile-edit-preview:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.profile-edit-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-edit-default {
    font-size: 4rem;
    color: #999;
}

/* 프로필 변경 버튼 */
.profile-change-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.profile-change-btn:hover {
    background: rgba(0, 86, 179, 0.9);
}

/* 프로필 이미지 삭제 버튼 (X 버튼) */
.profile-edit-preview .profile-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #dc3545;
    color: white;
    border: 2px solid white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-edit-preview:hover .profile-remove-btn {
    opacity: 1;
}

.profile-remove-btn:hover {
    background-color: #c82333;
    transform: scale(1.15);
}

/* 폼 */
.profile-edit-form .form-group {
    margin-bottom: 1.8rem;
}

.profile-edit-form .btn-block {
    margin-top: 0.5rem;
}

/* 회원 탈퇴 섹션 */
.account-delete-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.account-delete-section .btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.account-delete-section .btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* ============================================
   글쓰기 페이지
   ============================================ */
.write-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.write-container h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.write-form .form-group {
    margin-bottom: 1.5rem;
}

.write-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.write-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.write-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ============================================
   Rich Editor (contenteditable)
   ============================================ */
.content-editor-wrapper {
    position: relative;
}

.rich-editor {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.rich-editor:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* placeholder 스타일 */
.rich-editor:empty:before {
    content: attr(data-placeholder);
    color: #999;
    cursor: text;
}

/* ============================================
   에디터 내 이미지 관리
   ============================================ */

/* 이미지 컨테이너 (래퍼) */
.rich-editor .image-wrapper {
    position: relative;
    display: inline-block;
    margin: 10px 0;
    max-width: 100%;
    min-width: 100px;
}

/* 에디터 내부 이미지 스타일 */
.rich-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    transition: box-shadow 0.2s;
}

.rich-editor img:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 이미지 선택 시 */
.rich-editor .image-wrapper.selected {
    outline: 3px solid #2196F3;
    outline-offset: 2px;
}

.rich-editor .image-wrapper.selected img {
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* 이미지 삭제 버튼 */
.rich-editor .image-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.rich-editor .image-wrapper:hover .image-delete-btn,
.rich-editor .image-wrapper.selected .image-delete-btn {
    opacity: 1;
}

.rich-editor .image-delete-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* 리사이즈 영역 (오른쪽 하단 모서리) */
.rich-editor .image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    cursor: nwse-resize;
    z-index: 5;
}

/* 리사이징 중 */
.rich-editor .image-wrapper.resizing {
    outline: 3px dashed #2196F3;
}

.rich-editor .image-wrapper.resizing img {
    pointer-events: none;
    user-select: none;
}

/* ============================================
   에디터 툴바
   ============================================ */
.editor-toolbar {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.editor-toolbar .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.editor-toolbar small {
    color: #666;
    font-size: 0.85rem;
    margin-left: auto;
}

/* ============================================
   반응형 - 모바일
   ============================================ */
@media (max-width: 768px) {
    .auth-container,
    .write-container,
    .post-detail-container,
    .profile-edit-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .rich-editor {
        min-height: 300px;
        max-height: 500px;
        font-size: 13px;
    }

    .editor-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .editor-toolbar small {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .register-form-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .profile-section {
        order: -1;
    }

    .form-footer {
        grid-column: 1;
        margin-top: 1rem;
    }

    .btn-large {
        max-width: 100%;
    }

    .post-detail-header h2 {
        font-size: 1.5rem;
    }

    .post-detail-content {
        font-size: 1rem;
    }

    .post-detail-actions {
        flex-direction: column;
    }

    .post-card {
        padding: 1rem;
    }

    .post-card h3 {
        font-size: 1.1rem;
    }
}