:root {
    --cp-brand: #f05b42;
    --cp-brand-strong: #d94a35;
    --cp-brand-pale: #fff0e9;
    --cp-text: #202332;
    --cp-muted: #707381;
    --cp-border: #e1e6ed;
    --cp-bg: #f7f8fb;
    --cp-white: #fff;
    --cp-radius: 14px;
    --cp-shadow: 0 5px 22px rgba(25, 47, 84, .04);
    --cp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--cp-font);
    font-size: 14px;
    line-height: 1.65;
    color: var(--cp-text);
    background: var(--cp-bg);
    overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    font-size: 12px;
    min-height: 42px;
    color: var(--cp-text);
    border: 1px solid #d7dfeb;
    background: var(--cp-white);
    border-radius: 9px;
    padding: 9px 12px;
    width: 100%;
    max-width: 100%;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(240, 91, 66, .28);
    outline-offset: 2px;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

[hidden] {
    display: none !important;
}

.cp-container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.cp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 41px;
    border: 1px solid var(--cp-border);
    border-radius: 9px;
    padding: 9px 17px;
    background: var(--cp-white);
    font-weight: 700;
    white-space: nowrap;
}

.cp-button-primary {
    background: var(--cp-brand);
    border-color: var(--cp-brand);
    color: #fff;
}

.cp-button-primary:hover {
    background: var(--cp-brand-strong);
}

.cp-button-light {
    color: var(--cp-brand);
    background: var(--cp-brand-pale);
    border-color: var(--cp-brand-pale);
}

.cp-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    background: #f5f2f0;
    color: #5b5d68;
}

.cp-tag-warning {
    background: #fff2dc;
    color: #9b6108;
}

.cp-tag-success {
    background: #e8f8f0;
    color: #167c4c;
}

.cp-panel {
    background: #fff;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
}

.cp-muted {
    color: var(--cp-muted);
}

.cp-form-row {
    display: grid;
    gap: 7px;
    margin-bottom: 15px;
}

.cp-form-row label {
    font-weight: 700;
}

.cp-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.cp-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 620px;
}

.cp-table th,
.cp-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--cp-border);
    text-align: left;
    vertical-align: middle;
}

.cp-table th {
    background: #fff9f4;
    white-space: nowrap;
    font-size: 13px;
}

.cp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cp-pagination a,
.cp-pagination span {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    padding: 0 9px;
    background: #fff;
    border: 1px solid var(--cp-border);
}

.cp-pagination .is-current {
    background: var(--cp-brand);
    border-color: var(--cp-brand);
    color: #fff;
    font-weight: 700;
}

@media (max-width: 600px) {
    .cp-container {
        width: min(100% - 28px, 1120px);
    }

    body {
        font-size: 13px;
    }

    input,
    select,
    textarea {
        font-size: 14px;
    }
}

/* STEP 2-3: 광고주 업체정보 / 블로거 채널 관리 */
.cp-work-area { max-width: 1120px; }
.cp-work-area h1 { margin: 0 0 9px; font-size: 24px; }
.cp-work-form { padding: 24px; margin-top: 16px; }
.cp-work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.cp-work-grid > * { min-width: 0; }
.cp-work-wide { grid-column: 1 / -1; }
.cp-work-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 16px 0; }
.cp-work-status, .cp-work-notice, .cp-work-success, .cp-work-error { border-radius: 9px; padding: 12px 15px; margin: 12px 0; }
.cp-work-status { background: #eef4ff; border: 1px solid #dbe6ff; }
.cp-work-notice { background: #fff9e9; border: 1px solid #f3deb1; }
.cp-work-success { background: #edf9f2; border: 1px solid #b4e0c3; }
.cp-work-error { background: #fff0f0; color: #a92222; border: 1px solid #f2c2c2; }
.cp-work-check { display: flex; align-items: center; gap: 8px; }
.cp-work-check input { width: 17px; min-height: 17px; margin: 0; }
.cp-work-danger { color: #b02727; border: 1px solid #e9b7b7; }
.cp-work-table-wrap { margin-top: 16px; padding: 8px; }
.cp-work-break { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 650px) {
    .cp-work-grid { grid-template-columns: 1fr; }
    .cp-work-area h1 { font-size: 20px; }
    .cp-work-form { padding: 16px; }
}

/* STEP 3-1: 공지사항 및 FAQ */
.cp-board-layout { padding-top: 32px; padding-bottom: 58px; }
.cp-board-title { font-size: 26px; margin: 0 0 3px; }
.cp-board-panel { padding: 24px; margin-top: 18px; }
.cp-board-filters { display: flex; gap: 9px; justify-content: flex-end; margin-bottom: 18px; }
.cp-board-filters input { width: min(340px, 100%); }
.cp-board-filters select { width: 180px; }
.cp-board-filters button { flex: 0 0 auto; }
.cp-board-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--cp-border); }
.cp-board-list li { border-bottom: 1px solid var(--cp-border); }
.cp-board-list li a { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 17px 5px; }
.cp-board-list-title { min-width: 0; }
.cp-board-date { color: var(--cp-muted); font-size: 12px; white-space: nowrap; }
.cp-board-pin { font-size: 11px; color: var(--cp-brand); border: 1px solid #c8d8f7; padding: 2px 7px; border-radius: 5px; margin-right: 8px; }
.cp-board-empty { padding: 28px 8px; text-align: center; color: var(--cp-muted); }
.cp-board-pagination { margin-top: 20px; }
.cp-board-view-head { border-bottom: 1px solid var(--cp-border); padding-bottom: 17px; }
.cp-board-view-head h1 { font-size: 23px; overflow-wrap: anywhere; margin: 0 0 8px; }
.cp-board-content { padding: 24px 0; min-height: 150px; line-height: 1.85; }
.cp-board-image { margin: 15px 0; }
.cp-board-image img { max-width: 100%; border-radius: 8px; }
.cp-board-view-actions { border-top: 1px solid var(--cp-border); padding-top: 18px; }
.cp-board-faq { border-top: 1px solid var(--cp-border); }
.cp-board-faq:last-child { border-bottom: 1px solid var(--cp-border); }
.cp-board-faq summary { cursor: pointer; padding: 17px 8px; font-weight: 700; }
.cp-board-category { font-size: 11px; margin-right: 10px; color: var(--cp-brand); }
.cp-board-faq-answer { padding: 22px 16px; background: #f8faff; line-height: 1.85; }
@media (max-width: 600px) {
    .cp-board-layout { padding-top: 18px; }
    .cp-board-title { font-size: 21px; }
    .cp-board-panel { padding: 15px; }
    .cp-board-filters { flex-wrap: wrap; }
    .cp-board-filters input, .cp-board-filters select { width: 100%; flex: 1 1 150px; font-size: 14px; }
    .cp-board-list li a { align-items: flex-start; flex-direction: column; gap: 5px; }
    .cp-board-view-head h1 { font-size: 19px; }
}

/* STEP 3-2: 사이트 로고, 홈 배너, 팝업 */
.cp-site-logo {
    display: block;
    width: auto;
    max-width: 124px;
    max-height: 40px;
    object-fit: contain;
}
.cp-site-banner-section {
    display: grid;
    gap: 14px;
    padding-top: 22px;
    padding-bottom: 10px;
}
.cp-site-banner {
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #eef4ff;
}
.cp-site-banner a,
.cp-site-banner img {
    display: block;
    width: 100%;
}
.cp-site-banner img {
    height: auto;
    object-fit: cover;
}
.cp-footer-meta a {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cp-site-popup {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 32, 54, .55);
}
.cp-site-popup-card {
    position: relative;
    width: min(100%, 480px);
    max-height: 88vh;
    overflow: auto;
    border-radius: 14px;
    padding: 23px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}
.cp-site-popup-card h2 {
    margin: 0 36px 16px 0;
    font-size: 20px;
    line-height: 1.4;
}
.cp-site-popup-card img {
    display: block;
    max-width: 100%;
    max-height: 55vh;
    margin: 12px auto;
    object-fit: contain;
    border-radius: 8px;
}
.cp-site-popup-card p {
    margin: 12px 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.cp-site-popup-close {
    position: absolute;
    top: 12px;
    right: 13px;
    min-width: 34px;
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    background: #f0f3f8;
    color: #354259;
    font-size: 23px;
}
.cp-site-popup-dismiss {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 9px;
    background: #f4f6fa;
    border: 1px solid #dde4ef;
    border-radius: 8px;
    font-size: 12px;
}
@media (max-width: 600px) {
    .cp-site-logo { max-width: 92px; max-height: 32px; }
    .cp-site-banner-section { padding-top: 12px; }
    .cp-site-popup { padding: 12px; }
    .cp-site-popup-card { padding: 17px; }
    .cp-site-popup-card h2 { font-size: 17px; }
}

/* STEP 3-3 공통 컬러: 따뜻한 코랄·미색 테마 */
.cp-panel {box-shadow: 0 4px 18px rgba(34,29,26,.035);}
.cp-button-primary {box-shadow: 0 3px 10px rgba(240,91,66,.13);}
.cp-tag-warning {background:#fff0db;color:#a45f09;}
.cp-campaign-foot {color:#74747b;}
/* CKEditor 본문은 허용된 HTML만 서버에서 출력 */
.cp-board-content img,.cp-board-faq-answer img {display:block;max-width:100%;height:auto;margin:16px 0;border-radius:10px;}
.cp-board-content p,.cp-board-faq-answer p {margin:0 0 12px;}
.cp-board-content blockquote,.cp-board-faq-answer blockquote {padding:10px 16px;border-left:3px solid var(--cp-brand);background:#fff8f3;margin:12px 0;}
.cp-board-content a,.cp-board-faq-answer a {color:var(--cp-brand);text-decoration:underline;}
.cp-board-content table,.cp-board-faq-answer table {border-collapse:collapse;max-width:100%;}
.cp-board-content th,.cp-board-content td,.cp-board-faq-answer th,.cp-board-faq-answer td {border:1px solid var(--cp-border);padding:7px;}

/* UI-1: 사용자 목록과 카드의 구분 및 중앙 페이징 공통 기준 */
body.cp-user-site .cp-panel {
    background: #fff;
    border-color: #dfe5ed;
    box-shadow: 0 6px 22px rgba(33, 43, 61, .045);
}
body.cp-user-site .cp-table th {
    background: #f1f4f8;
    color: #273449;
}
body.cp-user-site .cp-table td {
    background: #fff;
}
body.cp-user-site .cp-pagination {
    margin-top: 22px;
    margin-bottom: 8px;
    justify-content: center;
    width: 100%;
}
body.cp-user-site .cp-work-table-wrap {
    background: #fff;
    border-radius: 13px;
}
