/* 블로그 반영 검사기 공통 스타일 (nicecompany 공용 테마) */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --line: #e6e8eb;
    --text: #1a1d21;
    --muted: #6b7280;
    --faint: #9aa1ab;
    --primary: #111827;
    --accent: #03c75a;
    --accent-soft: #e8f9ef;
    --red: #d92d20;
    --red-soft: #fee4e2;
    --amber: #b54708;
    --amber-soft: #fef0c7;
    --green: #067647;
    --green-soft: #dcfae6;
    --blue: #175cd3;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

.ic { vertical-align: -3px; flex: 0 0 auto; }

.mono { font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace; font-size: 13px; }

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

.faint { color: var(--faint); }

/* ── 상단 ── */

.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar .brand { display: flex; align-items: center; gap: 10px; }

.topbar .brand .mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
}

.topbar h1 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -.01em; }

.topbar .sub { font-size: 13px; color: var(--muted); margin-left: 4px; }

.topbar .spacer { flex: 1; }

/* ── 버튼 ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow);
    transition: background .12s, border-color .12s;
}

.btn:hover { background: #f8f9fb; border-color: #d5d8dd; }

.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn.primary:hover { background: #262b33; }

.btn.danger { color: var(--red); }

.btn.danger:hover { background: #fff5f4; border-color: #f4b8b2; }

.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--muted); }

.btn.ghost:hover { background: #eef0f3; color: var(--text); }

.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; }

.btn.icon { padding: 0; width: 34px; justify-content: center; }

.btn.icon.sm { width: 28px; }

.inline { display: inline; }

/* ── 본문 ── */

main { max-width: 1440px; margin: 0 auto; padding: 24px 28px 40px; }

.flash {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-soft);
    color: var(--green);
    border: 1px solid #b7ebc9;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
}

/* ── 카드 + 로그 박스 ── */

.top { display: flex; gap: 16px; align-items: stretch; margin-bottom: 20px; }

/* 카드는 전부 같은 높이(92px)다. 내용이 달라도 줄 높이가 흔들리지 않는다. */
.cards { display: grid; grid-template-columns: repeat(3, 156px); grid-auto-rows: 92px; gap: 12px; flex: 0 0 auto; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 92px;
    position: relative;
    transition: border-color .12s;
}

.card .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.card .num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }

.card .num.err { font-size: 14px; color: var(--red); }

.card.stat { cursor: pointer; }

.card.stat .num { font-size: 22px; }

.card .sub {
    /* 라벨 줄 오른쪽 끝에 시각만 작게. 숫자와 겹치지 않는다. */
    position: absolute;
    right: 14px;
    top: 14px;
    max-width: 48px;
    font-size: 11px;
    color: var(--faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.logbox {
    flex: 1 1 auto;
    min-width: 320px;
    /* 카드 두 줄 높이만큼만 차지한다. 로그가 많아도 이 안에서 스크롤된다. */
    max-height: 196px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logbox .head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.logbox .head strong { color: var(--text); font-size: 13px; font-weight: 600; }

.logbox .head .spacer { flex: 1; }

/* 실시간 표시 점. 켜져 있으면 초록으로 천천히 깜빡인다. (로그 박스, 목록 도구 줄 공용) */
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; }

.live.on { background: var(--accent); animation: pulse 2s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 켜고 끄는 스위치 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: 12px; user-select: none; }

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch .track { width: 30px; height: 17px; border-radius: 999px; background: #d1d5db; position: relative; transition: background .15s; }

.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.switch input:checked + .track { background: var(--accent); }

.switch input:checked + .track::after { left: 15px; }

.logbox .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 14px; }

.logbox .line { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px solid #f1f2f4; font-size: 12.5px; }

.logbox .line:last-child { border-bottom: 0; }

.logbox .line .t { color: var(--faint); flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.logbox .line .a { color: var(--blue); flex: 0 0 auto; min-width: 40px; }

.logbox .line .m { flex: 1 1 auto; white-space: pre-wrap; word-break: break-all; }

.logbox .line.err .m { color: var(--red); }

/* 새로 들어온 줄: 왼쪽에 얇은 초록 선을 두고 연한 배경이 몇 초에 걸쳐 사라진다. */
.logbox .line.new {
    box-shadow: inset 3px 0 0 var(--accent);
    padding-left: 8px;
    margin-left: -8px;
    animation: fadeNew 4s ease-out forwards;
}

@keyframes fadeNew {
    from { background: var(--accent-soft); }
    to   { background: transparent; }
}

.logbox .empty { color: var(--faint); padding: 24px; text-align: center; }

/* ── 도구 줄 ── */

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

.toolbar .spacer { flex: 1; }

.field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--faint);
    box-shadow: var(--shadow);
}

.field:focus-within { border-color: #9aa1ab; color: var(--muted); }

.field input {
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    color: var(--text);
    width: 260px;
}

.field input.short { width: 110px; }

.field select { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); padding-right: 4px; cursor: pointer; }

.field.select { color: var(--muted); }

.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }

/* 라디오를 붙여 놓은 선택 버튼. 실시간 / 목록 전환에 쓴다. */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); padding: 2px; }

.seg label { position: relative; margin: 0; }

.seg input { position: absolute; opacity: 0; width: 0; height: 0; }

.seg span { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; color: var(--muted); }

.seg label:hover span { color: var(--text); }

.seg input:checked + span { background: var(--primary); color: #fff; }

/* ── 표 ── */

.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table { border-collapse: collapse; width: 100%; min-width: 1040px; }

th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }

th { background: #fafbfc; font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: .01em; }

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover td { background: #fafbfc; }

td.num { color: var(--faint); font-variant-numeric: tabular-nums; }

td.actions { text-align: right; }

td.actions .btn { margin-left: 4px; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status.progress { background: var(--amber-soft); color: var(--amber); }

.status.failed { background: var(--red-soft); color: var(--red); }

.status.done { background: var(--green-soft); color: var(--green); }

select.status-select {
    font: inherit;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    margin-left: 6px;
}

.secret { cursor: pointer; color: var(--faint); letter-spacing: 2px; }

.secret[data-shown="1"] { color: var(--text); letter-spacing: 0; }

.edit-row td { background: #fffbe6; }

.edit-row .field { height: 30px; }

.edit-row .field input { width: 160px; }

.empty { padding: 48px; text-align: center; color: var(--faint); }

/* ── 페이지 넘김 ── */

.pager { display: flex; gap: 4px; align-items: center; margin: 14px 0; font-size: 13px; }

.pager .spacer { flex: 1; }

.pager .range { font-variant-numeric: tabular-nums; }

.pager .btn { min-width: 28px; justify-content: center; }

.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

.pager .btn.disabled { opacity: .35; pointer-events: none; }

/* ── 로그 페이지 ── */

table.logs { min-width: 0; }

table.logs td { white-space: normal; vertical-align: top; }

table.logs td.time { white-space: nowrap; color: var(--faint); font-variant-numeric: tabular-nums; }

table.logs td.msg { word-break: break-all; }

table.logs td.msg.err { color: var(--red); }

/* ── 모달 (이웃추가 설정) ── */

body.modal-open { overflow: hidden; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(16, 24, 40, .45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* hidden 속성이 display:flex 에 밀리지 않도록 명시한다. */
.modal-backdrop[hidden] { display: none; }

.modal {
    width: min(760px, 100%);
    height: min(80vh, 720px);
    background: var(--panel);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(16, 24, 40, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn .15s ease-out;
}

@keyframes modalIn {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.modal-head strong { display: flex; align-items: center; gap: 7px; font-size: 15px; }

.modal-head .spacer { flex: 1; }

.modal-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.modal-hint { padding: 10px 18px; font-size: 12.5px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); }

.modal-body textarea {
    flex: 1 1 auto;
    min-height: 0;
    border: 0;
    outline: 0;
    resize: none;
    padding: 14px 18px;
    font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    background: var(--panel);
}

.modal-body textarea:disabled { color: var(--faint); }

/* 모달 아래에 고정되는 저장 패널. 내용이 길어 스크롤돼도 항상 보인다. */
.modal-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
}

.modal-foot .spacer { flex: 1; }

.modal-foot .btn.primary { height: 36px; padding: 0 20px; }

/* ── 로그인 ── */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

.login {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
    width: 340px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, .06);
}

.login .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }

.login .brand .mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 17px;
    flex: 0 0 auto;
}

.login h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }

.login .field { width: 100%; height: 40px; }

.login .field input { width: 100%; }

.login .btn { width: 100%; height: 40px; justify-content: center; margin-top: 12px; }

.login .error { color: var(--red); font-size: 13px; margin-top: 10px; }

@media (max-width: 960px) {
    .top { flex-direction: column; }
    .logbox { height: 196px; }
    .cards { grid-template-columns: repeat(3, 1fr); }
    main { padding: 16px; }
    .topbar { padding: 0 16px; }
}


/* ══════════════════════════════════════════════════════════════
   블로그 반영 검사기 전용 보강. 위쪽은 nicecompany 공용 테마 그대로다.
   ══════════════════════════════════════════════════════════════ */

/* ── 상단 메뉴 ── */

.topbar nav { display: flex; gap: 2px; margin-left: 8px; }

.topbar nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    transition: background .12s, color .12s;
}

.topbar nav a:hover { background: #eef0f3; color: var(--text); }

.topbar nav a.active { background: var(--primary); color: #fff; }

/* ── 페이지 제목 줄 ── */

.page-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; }

.page-head h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }

.page-head .spacer { flex: 1; }

/* ── 일반 패널 (통계 카드와 달리 높이가 자유롭다) ── */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.panel > h3 { font-size: 14px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 7px; }

.panel > h3 .spacer { flex: 1; }

.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }

.panel-grid > .panel { margin-bottom: 0; }

/* 통계 카드 줄 (카드 개수가 달라도 한 줄에 맞춘다) */
.cards.auto { grid-template-columns: repeat(auto-fit, 156px); }

.card a { display: contents; }

.card.link:hover { border-color: #c9ced6; }

/* ── 폼 ── */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 16px; }

.form-grid .wide { grid-column: 1 / -1; }

.form-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.form-row > label { font-size: 12px; font-weight: 600; color: var(--muted); }

.input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    box-shadow: var(--shadow);
    outline: 0;
    transition: border-color .12s;
}

.input:focus { border-color: #9aa1ab; }

.input:disabled { background: #f8f9fb; color: var(--faint); }

select.input { cursor: pointer; padding-right: 28px; }

textarea.input {
    height: auto;
    min-height: 120px;
    padding: 9px 10px;
    line-height: 1.6;
    resize: vertical;
}

textarea.input.mono { font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace; font-size: 13px; }

.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; }

.form-actions .spacer { flex: 1; }

/* 도움말 */
.hint {
    font-size: 12.5px;
    color: var(--muted);
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    margin-top: 10px;
    line-height: 1.6;
}

.hint b { color: var(--text); font-weight: 600; }

.hint code, .kbd {
    font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace;
    font-size: 12px;
    background: #eef0f3;
    border-radius: 4px;
    padding: 1px 5px;
}

.note { font-size: 12px; color: var(--muted); margin-top: 6px; }

.note.err { color: var(--red); }

/* 알림 (실패) */
.flash.err { background: var(--red-soft); color: var(--red); border-color: #f4b8b2; }

/* ── 상태 (작업) ── */

.status.wait { background: #eef0f3; color: var(--muted); }

.status.checking { background: #dbeafe; color: var(--blue); }

/* ── 표 보강 ── */

table.fit { min-width: 0; }

td.wrap { white-space: normal; word-break: break-all; }

td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

td a.link { color: var(--blue); }

td a.link:hover { text-decoration: underline; }

.table-wrap + .table-wrap { margin-top: 16px; }

/* 왼쪽 목록 (제목 프리셋) */
.side-list a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); }

.side-list a:hover { background: #f4f5f7; }

.side-list a.active { background: var(--primary); color: #fff; }

.side-list a.active .muted, .side-list a.active .faint { color: rgba(255, 255, 255, .7); }

.side-list a .spacer { flex: 1; }

.side-list .count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* 진행 로그 상자 (작업 상세) */
.log-list { max-height: 420px; overflow-y: auto; }

.log-list .line { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f1f2f4; font-size: 12.5px; }

.log-list .line:last-child { border-bottom: 0; }

.log-list .line .t { color: var(--faint); flex: 0 0 auto; font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace; }

.log-list .line .m { flex: 1 1 auto; white-space: pre-wrap; word-break: break-all; }

.log-list .line.err .m { color: var(--red); }

/* 원고 본문 */
.manuscript {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 13.5px;
    max-height: 520px;
    overflow-y: auto;
    padding: 4px 2px;
}

/* 정의 목록 (작업 상세 요약) */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }

.kv dt { color: var(--muted); font-weight: 500; }

.kv dd { margin: 0; min-width: 0; word-break: break-all; }

@media (max-width: 960px) {
    .kv { grid-template-columns: 100px 1fr; }
    .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; }
    .topbar nav { flex-wrap: wrap; margin-left: 0; width: 100%; }
}

/* ── 상단바: 브랜드 폭을 고정해 메뉴가 페이지마다 움직이지 않게 한다 ── */

.topbar .brand { flex: 0 0 210px; width: 210px; overflow: hidden; white-space: nowrap; }

.topbar nav { margin-left: 0; }

.topbar .sub { margin-left: 0; margin-right: 14px; }

/* ── 폼 모달 (테마의 .modal 은 텍스트 편집용이라 높이가 고정이다. 폼은 내용만큼만 쓴다) ── */

.modal.form { height: auto; max-height: min(88vh, 900px); width: min(860px, 100%); }

.modal.form.wide { width: min(1040px, 100%); }

.modal.form > form { display: flex; flex-direction: column; min-height: 0; max-height: min(88vh, 900px); }

.modal-body.pad { padding: 18px; overflow-y: auto; }

.modal-body.pad .hint { margin-top: 12px; }

.modal-foot .btn.ghost { color: var(--muted); }

.page-head .btn { height: 32px; }

/* 모달 안의 폼 textarea 는 테마의 편집기용 규칙(.modal-body textarea, 테두리 없음)보다 우선해 입력란처럼 보이게 한다 */
.modal-body.pad textarea.input {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    resize: vertical;
    flex: none;
    min-height: 120px;
    line-height: 1.6;
    box-shadow: var(--shadow);
}

.modal-body.pad textarea.input:focus { border-color: #9aa1ab; }

/* 상단 메뉴 항목: 고정 폭 · 가운데 정렬 (글자 길이에 따라 위치가 바뀌지 않는다) */
.topbar nav a { width: 122px; padding: 0; justify-content: center; }

@media (max-width: 960px) {
    .topbar nav a { width: auto; padding: 0 11px; }
}

/* 페이지 제목 줄은 없앴다. 남은 것은 오른쪽 버튼 줄뿐이다. */
.page-head { margin: 0 0 14px; }
