/* ── Blog Marketing ─────────────────────────────────────────────────────── */
.bm { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

/* 헤더 */
.bm-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.bm-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary, #e4e4e7); margin: 0; }
.bm-status { display: flex; gap: 8px; margin-left: auto; }
.bm-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 99px; background: rgba(16,185,129,.15); color: #10b981; }
.bm-badge--off { background: rgba(239,68,68,.12); color: #ef4444; }

/* 탭 바 */
.bm-tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 20px; }
.bm-tab { padding: 8px 16px; font-size: 0.85rem; background: none; border: none; color: rgba(255,255,255,.45); cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; }
.bm-tab:hover { color: rgba(255,255,255,.7); }
.bm-tab--active { color: #10b981; border-bottom-color: #10b981; }

/* ── Dashboard 탭 ─────────────────────────────────────────────────────────── */
.bm-dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.bm-dash-card { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 16px; }
.bm-dash-card__label { font-size: 0.75rem; color: rgba(255,255,255,.4); margin-bottom: 4px; }
.bm-dash-card__value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary, #e4e4e7); }
.bm-dash-card__value--green { color: #10b981; }

.bm-dash-section { margin-bottom: 24px; }
.bm-dash-section h3 { font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,.6); margin-bottom: 12px; }

.bm-top-posts { display: flex; flex-direction: column; gap: 8px; }
.bm-top-post { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(255,255,255,.03); border-radius: 8px; }
.bm-top-post__title { font-size: 0.85rem; color: var(--text-primary, #e4e4e7); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-top-post__rev { font-size: 0.85rem; font-weight: 600; color: #10b981; margin-left: 12px; white-space: nowrap; }

/* ── Research 탭 ──────────────────────────────────────────────────────────── */
.bm-research-form { display: flex; gap: 8px; margin-bottom: 20px; }
.bm-research-input { flex: 1; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: var(--text-primary, #e4e4e7); font-size: 0.9rem; outline: none; }
.bm-research-input:focus { border-color: #10b981; }
.bm-research-input::placeholder { color: rgba(255,255,255,.25); }

.bm-btn { padding: 8px 18px; border-radius: 8px; border: none; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.bm-btn--primary { background: #10b981; color: #fff; }
.bm-btn--primary:hover { background: #059669; }
.bm-btn--primary:disabled { opacity: .5; cursor: not-allowed; }
.bm-btn--secondary { background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }
.bm-btn--secondary:hover { background: rgba(255,255,255,.12); }
.bm-btn--danger { background: rgba(239,68,68,.15); color: #ef4444; }
.bm-btn--danger:hover { background: rgba(239,68,68,.25); }
.bm-btn--sm { padding: 4px 10px; font-size: 0.75rem; }

.bm-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: bm-spin .6s linear infinite; display: inline-block; }
@keyframes bm-spin { to { transform: rotate(360deg); } }

/* 분석 카드 */
.bm-analyses { display: flex; flex-direction: column; gap: 12px; }
.bm-analysis-card { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 16px; }
.bm-analysis-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.bm-analysis-card__keyword { font-size: 1rem; font-weight: 700; color: var(--text-primary, #e4e4e7); }
.bm-analysis-card__date { font-size: 0.7rem; color: rgba(255,255,255,.3); }
.bm-analysis-card__scores { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.bm-score { text-align: center; }
.bm-score__label { font-size: 0.65rem; color: rgba(255,255,255,.4); display: block; margin-bottom: 2px; }
.bm-score__value { font-size: 1.1rem; font-weight: 700; }
.bm-score__value--high { color: #10b981; }
.bm-score__value--mid { color: #fbbf24; }
.bm-score__value--low { color: #ef4444; }
.bm-analysis-card__summary { font-size: 0.8rem; color: rgba(255,255,255,.5); line-height: 1.5; }
.bm-analysis-card__actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Write 탭 ─────────────────────────────────────────────────────────────── */
.bm-write-empty { text-align: center; padding: 60px 20px; color: rgba(255,255,255,.3); }
.bm-write-empty p { font-size: 0.85rem; margin-top: 8px; }

.bm-progress { margin-bottom: 20px; }
.bm-progress__bar { height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.bm-progress__fill { height: 100%; background: #10b981; border-radius: 2px; transition: width .3s; }
.bm-progress__text { font-size: 0.75rem; color: rgba(255,255,255,.4); }

.bm-preview { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.bm-preview__title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary, #e4e4e7); margin-bottom: 12px; }
.bm-preview__body { font-size: 0.85rem; color: rgba(255,255,255,.6); line-height: 1.7; max-height: 400px; overflow-y: auto; }
.bm-preview__body h1, .bm-preview__body h2, .bm-preview__body h3 { color: var(--text-primary, #e4e4e7); margin: 16px 0 8px; }
.bm-preview__body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.bm-preview__body th, .bm-preview__body td { border: 1px solid rgba(255,255,255,.1); padding: 6px 10px; font-size: 0.8rem; }
.bm-preview__body th { background: rgba(255,255,255,.06); }
.bm-preview__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.bm-tag { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; background: rgba(16,185,129,.12); color: #10b981; }

.bm-review-box { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.bm-review-box h4 { font-size: 0.85rem; font-weight: 600; color: var(--text-primary, #e4e4e7); margin-bottom: 10px; }
.bm-review-scores { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bm-review-score { text-align: center; min-width: 60px; }
.bm-review-score__label { font-size: 0.65rem; color: rgba(255,255,255,.4); display: block; }
.bm-review-score__val { font-size: 1rem; font-weight: 700; }
.bm-review-total { font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.bm-review-total--pass { color: #10b981; }
.bm-review-total--fail { color: #ef4444; }
.bm-review-feedback { font-size: 0.8rem; color: rgba(255,255,255,.5); line-height: 1.5; }

.bm-write-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Posts 탭 ─────────────────────────────────────────────────────────────── */
.bm-posts-filter { display: flex; gap: 4px; margin-bottom: 16px; }
.bm-filter-btn { padding: 4px 12px; border-radius: 6px; border: none; font-size: 0.75rem; background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); cursor: pointer; transition: all .15s; }
.bm-filter-btn--active { background: rgba(16,185,129,.15); color: #10b981; }

.bm-posts-list { display: flex; flex-direction: column; gap: 10px; }
.bm-post-card { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 14px 16px; }
.bm-post-card__top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.bm-post-card__title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary, #e4e4e7); flex: 1; }
.bm-post-card__status { font-size: 0.65rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; white-space: nowrap; margin-left: 8px; }
.bm-post-card__status--draft { background: rgba(255,255,255,.08); color: rgba(255,255,255,.5); }
.bm-post-card__status--reviewed { background: rgba(96,165,250,.15); color: #60a5fa; }
.bm-post-card__status--published { background: rgba(16,185,129,.15); color: #10b981; }
.bm-post-card__excerpt { font-size: 0.8rem; color: rgba(255,255,255,.4); margin-bottom: 8px; line-height: 1.4; }
.bm-post-card__meta { font-size: 0.7rem; color: rgba(255,255,255,.25); display: flex; gap: 12px; }
.bm-post-card__actions { display: flex; gap: 6px; margin-top: 10px; }

/* 발행 모달 */
.bm-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.bm-modal { background: #1e1e24; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 24px; width: 90%; max-width: 440px; }
.bm-modal h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary, #e4e4e7); margin-bottom: 12px; }
.bm-modal__input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: var(--text-primary, #e4e4e7); font-size: 0.85rem; outline: none; margin-bottom: 14px; }
.bm-modal__input:focus { border-color: #10b981; }
.bm-modal__buttons { display: flex; gap: 8px; justify-content: flex-end; }

/* ── 공통 빈 상태 ─────────────────────────────────────────────────────────── */
.bm-empty { text-align: center; padding: 48px 20px; color: rgba(255,255,255,.25); font-size: 0.85rem; }

/* ── 모바일 ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .bm-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bm-tabs > * {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .bm { padding: 16px 10px 60px; }
  .bm-header h1 { font-size: 1.2rem; }
  .bm-status { display: none; }
  .bm-tab { padding: 6px 10px; font-size: 0.8rem; }
  .bm-dash-cards { grid-template-columns: 1fr; }
  .bm-research-form { flex-direction: column; }
  .bm-analysis-card__scores { gap: 10px; }
  .bm-write-actions { flex-direction: column; }
  .bm-post-card__actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .bm-spinner { animation: none; }
}
