/* intorest.online — 웹 UI 스타일 (채널별 테마 변수) */
:root {
  --accent: #2f6bff;
  --accent-soft: #eef2ff;
  --accent-text: #2749a8;
  --radius: 12px;
  --border: #e5e7eb;
  --text: #1a1a1a;
  --muted: #8a8f98;
  --bg: #f7f8fa;
}

/* 채널별 테마 분기 */
body.channel-normal   { --accent: #2f6bff; --accent-soft: #eef2ff; --accent-text: #2749a8; }
body.channel-easytask { --accent: #0e9f6e; --accent-soft: #e6f7f0; --accent-text: #0b6e4d; }
body.channel-openkakao{ --accent: #f5c400; --accent-soft: #fdf8e0; --accent-text: #8a6d00; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
       background: var(--bg); color: var(--text); line-height: 1.5; }

/* ── 상단바 ── */
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex;
                justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.logo { font-size: 20px; font-weight: 800; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 14px; }
.nav a { color: var(--text); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--accent); }
.nav .who { color: var(--muted); font-weight: 600; }
.nav .btn-cta { background: var(--accent); color: #fff; padding: 7px 14px; border-radius: 8px; font-weight: 700; }
.nav .admin-link { color: var(--muted); font-size: 13px; }

/* ── 채널 바 ── */
.channel-bar { background: var(--accent); }
.channel-inner { display: flex; gap: 8px; align-items: center; padding: 10px 20px; flex-wrap: wrap; }
.channel-label { color: rgba(255,255,255,.85); font-size: 13px; font-weight: 700; margin-right: 4px; }
.chip { background: rgba(255,255,255,.18); color: #fff; border-radius: 20px; padding: 5px 14px;
        font-size: 13px; font-weight: 700; text-decoration: none; }
.chip.on { background: #fff; color: var(--accent); }
.channel-current { color: rgba(255,255,255,.8); font-size: 12px; margin-left: auto; }

/* ── 공통 ── */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.page-title .sub, .page-sub { font-size: 14px; color: var(--muted); font-weight: 400; }
.page-sub { margin-bottom: 12px; }
.mt { margin-top: 28px; }
.empty { text-align: center; color: #999; padding: 40px 0; }
.empty.small { padding: 14px; font-size: 13px; }
a { color: var(--accent); }
.back { display: inline-block; margin: 8px 0 12px; font-size: 14px; font-weight: 700; text-decoration: none; }
.link { font-size: 13px; word-break: break-all; }

/* ── 카드/버튼 ── */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.btn { display: inline-block; background: #f3f4f6; border: none; border-radius: 8px; padding: 10px 18px;
       font-size: 14px; font-weight: 700; cursor: pointer; color: #333; text-decoration: none; text-align: center; }
.btn.primary { background: var(--accent); color: #fff; width: 100%; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.danger { background: #dc2626; color: #fff; }
.btn:hover { opacity: .9; }
.input { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 12px;
         font-size: 14px; margin-bottom: 8px; }
.input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ── 플래시 ── */
.flashes { margin-bottom: 16px; }
.flash { padding: 11px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 8px; }
.flash-ok { background: #e6f7ed; color: #0a7a3d; }
.flash-error { background: #fef3f2; color: #b42318; }

/* ── 캠페인 카드 ── */
.card-grid, .camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
/* task_status 8종 필터 (admin 캠페인 요약) */
.status-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.status-filter .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 20px; background: #fff; border: 1px solid var(--border); color: #333;
  font-size: 12px; font-weight: 600; text-decoration: none; }
.status-filter .chip:hover { border-color: var(--accent); }
.status-filter .chip.on { border-color: var(--accent); background: var(--accent-soft, #eef4ff); color: var(--accent); }
.status-filter .chip b { font-size: 11px; opacity: .7; }

.camp-card.admin { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
             padding: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--text); position: relative; }
.camp-card.admin:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.camp-inner { text-decoration: none; color: var(--text); }
.camp-head { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 13px; font-weight: 800; color: var(--accent); }
.camp-name { font-size: 16px; font-weight: 800; }
.camp-meta { font-size: 13px; color: var(--muted); }
.camp-meta b { color: var(--text); }
.progress { height: 6px; background: #f0f1f3; border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; }
/* 캠페인 카드 하단 상태 직접 변경 select (admin 메인) */
.camp-status-edit { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-top: 6px; }
.camp-status-edit label { font-size: 11px; color: var(--muted); }
.camp-status-select { font-size: 12px; padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.progress-label { font-size: 12px; color: var(--muted); }
.soldout { color: #999; font-size: 13px; text-align: center; padding: 6px; }

/* ── 배지 ── */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
/* 관리자 실시간 상태 */
.live-dot { font-size: 11px; font-weight: 700; color: var(--accent); opacity: .9; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin: 6px 0 10px; }
.legend .badge { padding: 1px 8px; font-size: 11px; }
.legend-note { margin-left: 4px; }
.status-1 { background: #e6f7ed; color: #0a7a3d; }
.status-2 { background: #f3f4f6; color: #666; }
.status-3 { background: #fef3c7; color: #92400e; }
.status-4 { background: #e0e7ff; color: #3730a3; }
.status-5 { background: #fee2e2; color: #991b1b; }
.status-6 { background: #f3f4f6; color: #666; }
.status-7 { background: #f3f4f6; color: #666; }
.status-8 { background: #fce7f3; color: #9d174d; }
.rs-1 { background: #f3f4f6; color: #666; }
.rs-2 { background: #e0e7ff; color: #3730a3; }
.rs-3 { background: #fef3c7; color: #92400e; }
.rs-4 { background: #e6f7ed; color: #0a7a3d; }
.rs-5 { background: #d1fae5; color: #065f46; }
.rs-6 { background: #fee2e2; color: #991b1b; }
.rs-7 { background: #ede9fe; color: #5b21b6; }
.rs-8 { background: #e5e7eb; color: #374151; }

/* ── 미션 목록 ── */
.mission-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.mission-row { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
               padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.mission-row-main { flex: 1; min-width: 0; }
.mission-row-title { font-size: 15px; font-weight: 700; }
.mission-row-sub { font-size: 13px; color: var(--muted); }
.type-badge { display: inline-block; font-size: 12px; font-weight: 800; background: var(--accent-soft);
              color: var(--accent-text); padding: 4px 10px; border-radius: 6px; }
.type-badge.big { font-size: 14px; padding: 6px 14px; }

/* ── 미션 상세 ── */
.mission-hero { margin: 10px 0 18px; }
.mission-hero-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.point-big { font-size: 20px; font-weight: 900; color: var(--accent); margin-left: auto; }
.mission-title { font-size: 24px; font-weight: 900; }
.mission-sub { color: var(--muted); font-size: 14px; }
.guide-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-main section { margin-bottom: 18px; }
.guide-main h3 { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.guide-text { font-size: 15px; white-space: pre-wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700;
       padding: 4px 10px; border-radius: 6px; }
.meta-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
            border-top: 1px solid var(--border); padding-top: 12px; }
.side-card { margin-bottom: 12px; }
.status-line { display: flex; align-items: center; gap: 10px; }
.pt { font-weight: 800; color: var(--accent); }
.pt.inline { margin-top: 6px; font-size: 13px; }
.reject-box { margin-top: 10px; font-size: 13px; background: #fef3f2; color: #b42318;
              padding: 9px 12px; border-radius: 8px; }
.reject-box b { color: #991b1b; }

/* ── 내 제출 ── */
.my-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.my-card { padding: 16px 18px; }
.my-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.my-title { font-size: 15px; font-weight: 800; }
.my-sub { font-size: 13px; color: var(--muted); }
.my-body { font-size: 13px; }
.dates { color: var(--muted); font-size: 12px; margin-top: 6px; }
.resubmit-form { display: flex; gap: 8px; margin-top: 10px; }
.resubmit-form .input { margin-bottom: 0; flex: 1; }
.waiting { margin-top: 8px; color: var(--muted); font-size: 13px; }

/* ── 회원가입 ── */
.auth-wrap { max-width: 420px; margin: 20px auto; }
.auth-card .field { display: block; margin-bottom: 12px; }
.auth-card .field span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.id-check { display: block; font-size: 12px; margin-top: 2px; }
.id-check.ok { color: #0a7a3d; }
.id-check.bad { color: #b42318; }

/* ── 관리자 ── */
.admin-head { margin-top: 10px; }
.stat-row { display: flex; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
        padding: 14px 22px; text-align: center; min-width: 110px; }
.stat b { display: block; font-size: 24px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }
.subline { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.camp-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* 탭 */
.tabs { display: flex; gap: 8px; margin: 12px 0 16px; flex-wrap: wrap; }
.tab { background: #fff; border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px;
       font-size: 14px; font-weight: 700; cursor: pointer; color: #555; }
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 관리자 그리드 */
.admin-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.mission-tab-list { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }
.mission-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
                padding: 14px; cursor: pointer; }
.mission-item:hover, .mission-item.on { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.mission-item-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.mission-item-top .pt { font-size: 13px; margin-left: auto; }
.mission-item-title { font-size: 14px; font-weight: 700; }
.mission-item-sub { font-size: 12px; color: var(--muted); }

/* 검수 테이블 */
.table-wrap { overflow-x: auto; }
.review-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.review-table th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px 10px;
                   border-bottom: 2px solid var(--border); white-space: nowrap; }
.review-table td { padding: 10px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.review-table .url-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-table select { border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 6px; font-size: 12px; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.row-actions button { font-size: 11px; padding: 5px 9px; border: none; border-radius: 6px;
                      font-weight: 700; cursor: pointer; background: #f3f4f6; color: #333; }
.row-actions .primary { background: var(--accent); color: #fff; }
.row-actions .danger { background: #dc2626; color: #fff; }
.env-cell { font-size: 11px; color: var(--muted); }

/* 모달 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
              align-items: center; justify-content: center; z-index: 50; }
.modal-mask[hidden] { display: none; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: min(420px, 92vw); }
.modal h3 { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.modal-actions .btn { width: auto; }

/* 푸터 */
.footer { border-top: 1px solid var(--border); background: #fff; margin-top: 40px; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 18px 20px; font-size: 12px; color: var(--muted); }
/* Admin campaign groups share existing chips and card styling. */
.campaign-list-description { margin-top: 12px; font-size: 14px; color: #525866; }
.campaign-groups .chip { padding: 10px 16px; }
.campaign-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.campaign-list-empty { grid-column: 1 / -1; color: #525866; }
.campaign-list-empty a { display: inline-block; margin-top: 8px; }
.campaign-list .camp-name { overflow-wrap: anywhere; }
.campaign-groups a:focus-visible, .campaign-list a:focus-visible,
.campaign-list select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
