* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { font-family: 'Malgun Gothic', sans-serif; background: #f5f5f5; color: #333; }

.user-nav { background: #2c3e50; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; position: relative; }
.user-nav .nav-brand { color: #fff; font-size: 18px; font-weight: bold; }
.user-nav .nav-links a { color: #ecf0f1; text-decoration: none; margin-left: 20px; font-size: 14px; }
.user-nav .nav-links a:hover { color: #3498db; }
.user-nav .nav-toggle { display: none; background: transparent; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 8px; line-height: 1; }
.user-nav .nav-close { display: none; position: absolute; top: 14px; right: 14px; background: transparent; border: none; color: #fff; font-size: 26px; cursor: pointer; line-height: 1; }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 999; }
.nav-backdrop.open { display: block; }

@media (max-width: 768px) {
    .user-nav .nav-toggle { display: block; }
    .user-nav .nav-links {
        position: fixed;
        top: 0; right: 0;
        height: 100%;
        width: 240px;
        background: #2c3e50;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        z-index: 1000;
        padding: 60px 20px 20px;
        box-shadow: -4px 0 12px rgba(0,0,0,0.3);
        display: flex;
        flex-direction: column;
    }
    .user-nav .nav-links.open { transform: translateX(0); }
    .user-nav .nav-links a {
        display: block;
        margin: 0 0 4px;
        font-size: 16px;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .user-nav .nav-close { display: block; }
}

.user-content { max-width: 800px; margin: 20px auto; padding: 0 15px; }

/* 모바일 하단 탭바 — 데스크탑에선 숨김 */
.user-tabbar { display: none; }
@media (max-width: 768px) {
    /* 가로 오버플로 차단 — 한쪽 페이지가 viewport 폭 넘치면 탭바도 같이 늘어나서 viewport 바깥으로 밀림 */
    html, body { overflow-x: hidden; max-width: 100vw; }
    .user-tabbar {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: auto;
        width: 100vw;
        box-sizing: border-box;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
        z-index: 950;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .user-tab {
        flex: 1;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px;
        padding: 7px 4px 6px;
        text-decoration: none;
        color: #999;
        background: transparent; border: none;
        cursor: pointer;
        font: inherit;
        position: relative;
        min-height: 54px;
    }
    .user-tab .ic { font-size: 20px; line-height: 1; }
    .user-tab .lbl { font-size: 11px; font-weight: 500; }
    .user-tab.active { color: #3498db; }
    .user-tab.active .lbl { font-weight: 700; }
    .user-tab-dot {
        position: absolute;
        top: 6px; right: calc(50% - 16px);
        width: 8px; height: 8px;
        background: #e74c3c;
        border-radius: 50%;
        border: 2px solid #fff;
        box-sizing: content-box;
    }
    .user-content { padding-bottom: 80px; }

    /* 카드 안에서 긴 텍스트(URL/계좌번호 등) 자동 줄바꿈 */
    .user-content .card { word-break: break-word; overflow-wrap: anywhere; }
    /* 표는 가로 스크롤로 가둠 — 카드/페이지 폭 넘치는 것 방지 */
    .mi-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .mi-table-wrap > table { min-width: 100%; }
}

/* 데스크탑 + 모바일 공용: 표 wrap (모바일에서만 효과) */
.mi-table-wrap { width: 100%; }

.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.card h2 { margin-bottom: 15px; font-size: 18px; }
.card h3 { margin-bottom: 10px; font-size: 16px; color: #2c3e50; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;
}
.form-group textarea { resize: vertical; min-height: 80px; }

.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; }
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: #27ae60; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-secondary { background: #95a5a6; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { background: #bdc3c7; cursor: not-allowed; }

.campaign-card { border-left: 4px solid #3498db; }
.campaign-card.closed { border-left-color: #95a5a6; opacity: 0.7; }
.campaign-card .meta { color: #666; font-size: 13px; margin-top: 8px; }
.campaign-card .price { font-size: 20px; font-weight: bold; color: #e74c3c; }
.type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.02em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.campaign-card .type-badge { margin-bottom: 8px; }
.type-badge.원고료제공형 { background: rgba(230, 126, 34, 0.88); }
.type-badge.상품체험형 { background: rgba(241, 196, 15, 0.95); color: #5d4413; }
.type-badge.구매확정형 { background: rgba(52, 152, 219, 0.88); }
.type-badge.qna { background: rgba(155, 89, 182, 0.88); }

.status-badge {
    display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 12px; color: #fff;
}
.status-badge.신청 { background: #f39c12; }
.status-badge.선정완료 { background: #3498db; }
.status-badge.구매완료 { background: #2ecc71; }
.status-badge.리뷰완료 { background: #27ae60; }
.status-badge.지급완료 { background: #8e44ad; }
.status-badge.취소 { background: #95a5a6; }
.status-badge.대기 { background: #f39c12; }
.status-badge.확인요청 { background: #e67e22; }
.status-badge.확인됨 { background: #27ae60; }
.status-badge.미흡 { background: #e74c3c; }
.status-badge.기한초과 { background: #c0392b; }

.open-time-notice { background: #fff3cd; padding: 10px; border-radius: 4px; text-align: center; color: #856404; margin-top: 10px; }

.alert { padding: 12px; border-radius: 4px; margin-bottom: 15px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
table th { background: #f8f9fa; font-weight: bold; }

.login-container { max-width: 400px; margin: 80px auto; }
