/**
 * 모바일 전용 CSS
 * m.jj0u.com 모바일 최적화 스타일
 */

/* ========================================
   1. 기본 리셋 및 모바일 최적화
======================================== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", "Segoe UI",
        Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 가로 스크롤 절대 금지 */
html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* ========================================
   2. 헤더/네비게이션
======================================== */
.m-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    border-bottom: 2px solid #0096ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.m-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 12px;
}

.m-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.m-logo img {
    height: 28px;
    width: auto;
}

.m-header-actions {
    display: flex;
    align-items: center;
    gap: 13px;
}

.m-btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    min-height: 35px;
}

.m-btn-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* 상단 네비게이션 메뉴 */
.m-nav {
    background: #0096ff;
    height: 45px;
    display: flex;
    align-items: center;
}

.m-nav > div {
    display: flex;
    align-items: center;
    height: 100%;
    overflow-x: auto;
    padding: 0 12px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
}

.m-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    font-size: 16px;
    font-weight: 450;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.m-nav-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.m-nav-item.is-active {
    color: #fff;
    font-weight: 600;
    border-bottom-color: #fff;
}

/* ========================================
   3. 카드형 게시글 리스트
======================================== */
.m-board-list {
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fff;
}

.m-board-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    min-height: 60px;
}

.m-board-item:active {
    background-color: #f8f8f8;
}

/* 공지사항 스타일 */
.m-board-item.is-notice {
    background-color: #f8fafc;
}

.m-board-item.is-notice .m-board-title::before {
    content: "공지";
    display: inline-block;
    padding: 2px 6px;
    margin-right: 6px;
    background: #0096ff;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    vertical-align: middle;
}

/* 제목 줄 */
.m-board-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.m-board-title {
    flex: 1;
    font-size: 15px;
    font-weight: 400;
    color: #222;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* 배지들 */
.m-board-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.m-badge img {
    width: 14px;
    height: 14px;
}

.m-badge-current {
    display: inline-block;
    background-color: #0096ff;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.m-board-list .current-post .m-board-item {
    background-color: #f0f8ff;
}

.m-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

/* 댓글 수 */
.m-board-comment-cnt {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #e1241a;
}

/* 메타 정보 줄 */
.m-board-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.m-board-category {
    color: #666;
    font-weight: 500;
}

.m-board-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

.m-board-author img {
    width: 14px;
    height: 14px;
}

.m-board-separator {
    color: #ddd;
}

/* ========================================
   4. 게시글 상세 뷰
======================================== */
.m-post-container {
    background: #fff;
    min-height: 100vh;
}

.m-post-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.m-post-category {
    display: inline-block;
    padding: 4px 8px;
    margin-bottom: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.m-post-title {
    margin: 0 0 12px;
    font-size: 25px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    word-break: break-word;
}

.m-post-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888;
}

.m-post-author {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #333;
    font-weight: 500;
}

.m-post-author img {
    width: 16px;
    height: 16px;
}

/* 본문 영역 */
.m-post-content {
    padding: 16px;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 본문 내 이미지 최적화 */
.m-post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px 0;
}

/* 본문 내 iframe (유튜브 등) 반응형 */
.m-post-content iframe {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* 본문 내 테이블 스크롤 */
.m-post-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 본문 내 코드 블록 */
.m-post-content pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
}

/* ========================================
   5. 추천/비추천 버튼
======================================== */
.m-post-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid #eee;
}

.m-btn-like,
.m-btn-dislike {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 70px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.m-btn-like {
    background: #f04040;
    color: #fff;
}

.m-btn-like:active {
    background: #e53935;
}

.m-btn-dislike {
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
}

.m-btn-dislike:active {
    background: #f5f5f5;
}

.m-btn-like-icon,
.m-btn-dislike-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.m-btn-like-text,
.m-btn-dislike-text {
    font-size: 13px;
}

/* ========================================
   6. 댓글 영역
======================================== */
.m-comment-section {
    background: #fff;
    padding: 16px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.m-comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.m-comment-count {
    margin-left: 4px;
    color: #0096ff;
}

/* 댓글 입력 폼 */
.m-comment-form {
    padding: 16px 5px;
    background: #f5f5f5;
}

.m-comment-textarea {
    width: 100%;
    min-height: 130px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px; /* iOS 확대 방지 */
    line-height: 1.5;
    resize: none;
    -webkit-appearance: none;
}

.m-comment-textarea:focus {
    outline: none;
    border-color: #0096ff;
}

.m-comment-submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.m-btn-submit {
    padding: 10px 20px;
    background: #0096ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
}

.m-btn-submit:active {
    background: #0080e0;
}

/* 댓글 리스트 - 새 스타일 */
.reply-list {
    margin: 0 0 20px 0;
    padding: 0;
}

.reply {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.reply.is-reply {
    margin-left: 20px;
    border-left: 2px solid #eee;
    padding-left: 12px;
}

.reply_info {
    margin-bottom: 8px;
}

.list_userinfo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.pop_user {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.reply_date {
    font-size: 11px;
    color: #999;
}

.btn_block {
    margin-left: auto;
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
}

.btn_block:active {
    background: #f5f5f5;
}

.icon_block {
    width: 16px;
    height: 16px;
}

.ml5 {
    margin-left: 5px;
}

.reply_content {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-break: break-word;
}

.reply_btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reply-recommend {
    margin-top: 8px;
}

.border-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    color: #666;
    min-height: 32px;
}

.bgW {
    background: #fff;
}

.border-box:active {
    background: #f5f5f5;
}

.btn-vote-comment strong {
    margin-left: 4px;
}

.btn-vote-comment strong.red {
    color: #f04040;
}

.btn-vote-comment strong.gray {
    color: #888;
}

.right-box {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.btn_write_reply1 {
    padding: 6px 12px;
}

/* 토스트 팝업 */
.toast_component {
    border: 1px solid #dfdfdf;
    border-radius: 6px;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
    background: #fff;
    z-index: 100001;
    position: fixed;
    min-width: 260px;
}

.toast_comp-box {
    position: relative;
    padding: 20px;
}

.toast_comp-box h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.comp-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.toast_component .btn-wrap {
    display: flex;
    height: 40px;
    border-top: 1px solid #d8d8d8;
}

.toast_component .btn-wrap a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.toast_component .btn-wrap a:first-child {
    border-right: 1px solid #d8d8d8;
    color: #999;
}

.toast_component .btn-wrap a:last-child {
    color: #0096ff;
    font-weight: 600;
}

.toast_component .btn-wrap a:active {
    background: #f5f5f5;
}

/* 댓글 리스트 (기존 스타일 유지) */
.m-comment-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #e0e0e0;
}

.m-comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.m-comment-item:last-child {
    border-bottom: none;
}

/* 대댓글 들여쓰기 */
.m-comment-item.is-reply {
    padding-left: 24px;
    position: relative;
}

.m-comment-item.is-reply::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-left: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
}

.m-comment-author-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.m-comment-author {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.m-comment-author img {
    width: 14px;
    height: 14px;
}

.m-comment-date {
    font-size: 12px;
    color: #999;
}

.m-comment-content {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-break: break-word;
}

.m-comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.m-comment-action-btn {
    padding: 6px 0;
    background: transparent;
    border: none;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    min-height: 32px;
}

.m-comment-action-btn:active {
    color: #0096ff;
}

/* ========================================
   7. 글쓰기/수정 폼
======================================== */
.m-form-container {
    background: #fff;
    min-height: 100vh;
}

.m-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 12px;
    border-bottom: 1px solid #eee;
}

.m-form-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.m-btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.m-btn-register {
    padding: 8px 16px;
    background: #0096ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
}

.m-form-body {
    padding: 16px;
}

.m-form-group {
    margin-bottom: 16px;
}

.m-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.m-form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px; /* iOS 확대 방지 */
    -webkit-appearance: none;
}

.m-form-input:focus {
    outline: none;
    border-color: #0096ff;
}

.m-form-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    -webkit-appearance: none;
}

.m-form-textarea:focus {
    outline: none;
    border-color: #0096ff;
}

/* 에디터 툴바 */
.m-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.m-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
}

.m-toolbar-btn:active {
    background: #f0f0f0;
}

/* ========================================
   8. 하단 버튼 바
======================================== */
.m-bottom-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e0e0e0;
}

.m-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    min-height: 30px;
    border: 1px solid #ddd;
}

.m-btn-primary {
    background: #0096ff;
    color: #fff;
}

.m-btn-primary:active {
    background: #0080e0;
}

.m-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.m-btn-secondary:active {
    background: #e0e0e0;
}

.m-btn-danger {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.m-btn-danger:active {
    background: #fff5f5;
}

.m-btn-block {
    flex: 1;
}

/* ========================================
   9. 페이지네이션
======================================== */
.m-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 16px;
}

.m-pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

.m-pagination-btn.is-active {
    background: #0096ff;
    border-color: #0096ff;
    color: #fff;
    font-weight: 600;
}

.m-pagination-btn:active {
    background: #f0f0f0;
}

.m-pagination-btn.is-active:active {
    background: #0080e0;
}

/* ========================================
   10. 유틸리티 클래스
======================================== */
.m-text-center {
    text-align: center;
}
.m-text-left {
    text-align: left;
}
.m-text-right {
    text-align: right;
}

.m-mt-8 {
    margin-top: 8px;
}
.m-mt-16 {
    margin-top: 16px;
}
.m-mb-8 {
    margin-bottom: 8px;
}
.m-mb-16 {
    margin-bottom: 16px;
}
.m-p-16 {
    padding: 16px;
}

.m-hidden {
    display: none !important;
}

/* 빈 상태 */
.m-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.m-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.m-empty-state-text {
    font-size: 15px;
}

/* 로딩 상태 */
.m-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.m-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #0096ff;
    border-radius: 50%;
    animation: m-spin 0.8s linear infinite;
}

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

/* 토스트 메시지 */
.m-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    animation: m-toast-in 0.3s ease;
}

@keyframes m-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   11. 푸터
======================================== */
.m-footer {
    padding: 20px 16px;
    background: #f5f5f5;
    text-align: center;
    border-top: 2px solid #0096ff;
}

.m-footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.m-footer-link {
    font-size: 13px;
    color: #666;
    text-decoration: none;
}

/* ========================================
   top 버튼
======================================== */
.quick_btn {
    position: fixed;
    bottom: 28px;
    right: 13px;
    width: 50px;
    z-index: 5;
    display: none;
}

.quick_btn a.btn-top span {
    font-weight: bold;
}

.btn-top {
    display: block;
    height: 50px;
    background-size: 70%;
    padding-top: 13px;
    padding-right: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick_btn a.btn-top span {
    font-size: 0.7em;
    font-weight: bold;
    color: rgb(51, 51, 51);
}

.m-footer-copyright {
    font-size: 12px;
    color: #999;
}

.m-pc-version-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
}

/* 댓글 카운트 뱃지 */
.m-comment-count-badge {
    display: inline-block;
    padding: 4px 12px;
    margin-top: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.m-comment-count-badge:active {
    background-color: #f5f5f5;
}

.m-comment-count-badge span {
    color: #333;
}

.m-comment-count-badge .m-comment-count-number {
    color: #e1241a;
    font-weight: 500;
}


/* ========================================
   아이콘 모음
   ======================================== */
.ico-pc {
    background: url("../img/common/icon_common.png");
    display: inline-block;
    overflow: hidden;
    text-indent: -3000px;
}

/*신고 아이콘*/
.report {
    width: 12px;
    height: 12px;
    background-position: -149px -176px;
}

.report:hover {
    background-position: -167px -176px;
}
