/* =============================================
   뱉크루 실험일지 — 공통 스타일
   ============================================= */

/* Reset */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* CSS Variables (superset — 미사용 변수는 무시됨) */
:root{
  --bg:#fafafa;--surface:#fff;--surface-hover:#f5f5f5;
  --text:#0a0a0a;--text-secondary:#404040;--text-tertiary:#737373;
  --border:#e5e5e5;--border-light:#f0f0f0;
  --accent:#16a34a;--accent-light:#dcfce7;--accent-dark:#15803d;
  --radius:12px;--radius-sm:8px;--radius-xs:6px;
  --shadow:0 1px 3px rgba(0,0,0,.05),0 1px 2px rgba(0,0,0,.03);
  --shadow-lg:0 10px 25px rgba(0,0,0,.07),0 4px 10px rgba(0,0,0,.03);
  --shadow-xl:0 20px 50px rgba(0,0,0,.1);
  --transition:all .2s ease;
  /* category colors */
  --c-growth:#1d4ed8;--c-growth-bg:#dbeafe;
  --c-marketing:#854d0e;--c-marketing-bg:#fef9c3;
  --c-branding:#be185d;--c-branding-bg:#fce7f3;
  --c-design:#9a3412;--c-design-bg:#ffedd5;
  --c-data:#16a34a;--c-data-bg:#dcfce7;
  --c-proposal:#b45309;--c-proposal-bg:#fef3c7;
  --c-creative:#7c3aed;--c-creative-bg:#ede9fe;
  --c-comm:#0e7490;--c-comm-bg:#cffafe;
  /* industry colors */
  --c-ind-beauty:#be185d;--c-ind-beauty-bg:#fce7f3;
  --c-ind-fintech:#4338ca;--c-ind-fintech-bg:#e0e7ff;
  --c-ind-enter:#7c3aed;--c-ind-enter-bg:#ede9fe;
  --c-ind-food:#b45309;--c-ind-food-bg:#fef3c7;
  --c-ind-it:#0369a1;--c-ind-it-bg:#e0f2fe;
  --c-ind-elec:#1d4ed8;--c-ind-elec-bg:#dbeafe;
  --c-ind-ecom:#c2410c;--c-ind-ecom-bg:#ffedd5;
  --c-ind-travel:#0f766e;--c-ind-travel-bg:#ccfbf1;
  --c-ind-auto:#475569;--c-ind-auto-bg:#f1f5f9;
  --c-ind-life:#059669;--c-ind-life-bg:#d1fae5;
  --c-ind-fb:#9a3412;--c-ind-fb-bg:#fff7ed;
  --c-ind-ngo:#6d28d9;--c-ind-ngo-bg:#f5f3ff;
  --c-ind-internal:#0e7490;--c-ind-internal-bg:#cffafe;
  --c-ind-edu:#854d0e;--c-ind-edu-bg:#fef9c3;
  --c-ind-corp:#64748b;--c-ind-corp-bg:#f1f5f9;
}

/* Base */
html{font-size:16px;scroll-behavior:smooth}
body{font-family:'Pretendard Variable',Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,sans-serif;background:var(--bg);color:var(--text);line-height:1.6;min-height:100vh}

/* Page Header (submit + admin 공용) */
.page-header{background:#0a0a0a;color:#fff;padding:1.5rem 2rem}
.page-header h1{font-size:1.25rem;font-weight:700}
.page-header h1 span{color:#4ade80}
.back-link{color:#a3a3a3;text-decoration:none;font-size:.875rem;transition:var(--transition)}
.back-link:hover{color:#fff}

/* Field — 공통 기반 스타일 (margin은 각 페이지에서 설정) */
.field label{display:block;font-size:.8125rem;font-weight:600;margin-bottom:.375rem;color:var(--text)}
.field label .req{color:#ef4444;margin-left:2px}
.field input,.field textarea,.field select{width:100%;padding:.625rem .875rem;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:.875rem;font-family:inherit;background:var(--surface);outline:none;transition:var(--transition)}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-light)}
.field textarea{resize:vertical;line-height:1.6}
.field .hint{font-size:.75rem;color:var(--text-tertiary);margin-top:.25rem}

/* Btn — 공통 기반 (padding/font-size는 각 페이지에서 설정) */
.btn{border-radius:var(--radius-sm);font-weight:600;font-family:inherit;cursor:pointer;transition:var(--transition);border:none}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:var(--accent-dark)}
.btn:disabled{opacity:.5;cursor:not-allowed}

/* Toast */
.toast{position:fixed;bottom:2rem;left:50%;transform:translateX(-50%);background:#0a0a0a;color:#fff;padding:.75rem 1.5rem;border-radius:var(--radius-sm);font-size:.875rem;font-weight:500;z-index:999;display:none}
.toast.show{display:block;animation:toastIn .3s ease}
.toast.error{background:#ef4444}
@keyframes toastIn{from{opacity:0;transform:translateX(-50%) translateY(10px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}

/* ===== Slack Autocomplete ===== */
.slack-ac-wrap{position:relative}
.slack-ac-dropdown{position:absolute;top:100%;left:0;right:0;z-index:60;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);max-height:220px;overflow-y:auto;display:none;margin-top:2px}
.slack-ac-dropdown.show{display:block}
.slack-ac-item{display:flex;align-items:center;gap:.625rem;padding:.5rem .75rem;cursor:pointer;transition:background .15s}
.slack-ac-item:hover,.slack-ac-item.active{background:var(--surface-hover)}
.slack-ac-avatar{width:28px;height:28px;border-radius:50%;flex-shrink:0;background:var(--accent-light);display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;color:var(--accent-dark);overflow:hidden}
.slack-ac-avatar img{width:100%;height:100%;object-fit:cover}
.slack-ac-info{flex:1;min-width:0}
.slack-ac-name{font-size:.8125rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.slack-ac-title{font-size:.6875rem;color:var(--text-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.slack-ac-empty{padding:.75rem;text-align:center;color:var(--text-tertiary);font-size:.8125rem}

/* Slack Profile Link */
.slack-link{color:var(--accent-dark);text-decoration:none;border-bottom:1px dashed var(--accent);padding-bottom:1px;transition:var(--transition);cursor:pointer}
.slack-link:hover{border-bottom-style:solid;color:var(--accent)}

/* ===== Upload Progress Tag (submit 첨부 / admin 첨부) ===== */
.upload-progress-tag{font-size:.75rem;background:var(--surface-hover);border:1px solid var(--border-light);padding:4px 10px;border-radius:12px;display:inline-flex;align-items:center;gap:8px;max-width:100%}
.upload-progress-tag .up-name{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-secondary)}
.upload-progress-tag .up-bar{width:90px;height:6px;border-radius:3px;background:var(--border);overflow:hidden;flex:0 0 auto}
.upload-progress-tag .up-bar-fill{display:block;height:100%;width:0%;background:var(--accent);border-radius:3px;transition:width .15s ease}
.upload-progress-tag .up-pct{font-variant-numeric:tabular-nums;color:var(--text-tertiary);min-width:34px;text-align:right}
.upload-progress-tag.error{border-color:#ef4444;background:#fef2f2}
.upload-progress-tag.error .up-bar-fill{background:#ef4444}
.upload-progress-tag.error .up-pct{color:#ef4444;font-weight:600}

/* ===== 케이스 본문 렌더링 공용 스타일 =====
   index.html 상세 모달 + admin.html 실시간 미리보기가 함께 사용.
   renderCaseContent(common.js)의 출력(.exp-sections | .content-rendered)에 대응 */

/* ── 통일 섹션 레이아웃 — 질문(강조) → 내용 → 구분선 순 ── */
.exp-sections{font-size:1.0625rem;line-height:2.1;color:#111}
.exp-section{padding:1.5rem 0;border-bottom:1px solid var(--border-light)} /* 내용 끝 = 구분선 */
.exp-section:first-child{padding-top:.25rem}
.exp-section:last-child{border-bottom:none}
.exp-section-head{display:flex;align-items:center;gap:.625rem;margin-bottom:.875rem}
.exp-section-emoji{width:34px;height:34px;border-radius:9px;background:var(--accent-light);display:inline-flex;align-items:center;justify-content:center;font-size:1.0625rem;line-height:1;flex-shrink:0}
.exp-section-title{font-size:1.125rem;font-weight:800;color:var(--text);letter-spacing:-.015em}
.exp-section-body p{margin-bottom:1rem;color:#222;line-height:2.05}
.exp-section-body p:last-child{margin-bottom:0}
.exp-section-body ul,.exp-section-body ol{margin:0 0 1rem 0;padding:0}
.exp-section-body ul{list-style:none}
.exp-section-body ul>li{position:relative;padding-left:1.5rem;margin-bottom:.625rem;line-height:1.85}
.exp-section-body ul>li::before{content:'';position:absolute;left:.125rem;top:.72rem;width:6px;height:6px;border-radius:50%;background:var(--accent);opacity:.7}
.exp-section-body ol{list-style:decimal;padding-left:1.5rem}
.exp-section-body ol>li{margin-bottom:.625rem;padding-left:.25rem;line-height:1.85}
.exp-section-body strong{font-weight:700;color:#0a0a0a}
.exp-section-body a{color:var(--accent-dark);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.exp-section-body a:hover{color:var(--accent)}
.exp-section-body img{max-width:100%;border-radius:var(--radius-sm);margin:1rem 0;box-shadow:0 2px 12px rgba(0,0,0,.08);display:block}
.exp-section-body blockquote{background:#f0fdf4;border:1px solid #bbf7d0;border-left:4px solid var(--accent);border-radius:0 var(--radius-sm) var(--radius-sm) 0;padding:.875rem 1.125rem;margin:1rem 0;color:#166534}
.exp-section-body blockquote p{color:#166534;line-height:1.8}
@media(max-width:768px){
  .exp-section-body ul>li{padding-left:1.25rem}
}

/* ── 폴백 본문 타이포그래피 (섹션 파싱 불가 케이스) ── */
.content-rendered{font-size:1.0625rem;line-height:2.1;color:#111}
.content-rendered aside{display:block;background:#f0fdf4;border:1px solid #bbf7d0;border-left:4px solid var(--accent);border-radius:0 var(--radius-sm) var(--radius-sm) 0;padding:1.25rem 1.5rem;margin:1.5rem 0}
.content-rendered h1{font-size:1.75rem;font-weight:800;color:var(--text);margin:2.5rem 0 1rem;letter-spacing:-.025em;line-height:1.3}
/* h2 = 질문 헤더: 크게 + 이전 내용과의 사이에 구분선 (질문-내용-구분선 순) */
.content-rendered h2{font-size:1.25rem;font-weight:800;color:var(--text);margin:2rem 0 1rem;letter-spacing:-.015em}
.content-rendered h2:not(:first-child){border-top:1px solid var(--border-light);padding-top:1.75rem;margin-top:2.25rem}
.content-rendered h3{font-size:1.0625rem;font-weight:700;color:var(--text);margin:2rem 0 .75rem;letter-spacing:-.01em}
.content-rendered h4{font-size:1rem;font-weight:600;color:var(--text-secondary);margin:1.5rem 0 .5rem}
.content-rendered h1:first-child,.content-rendered h2:first-child,.content-rendered h3:first-child{margin-top:0}
.content-rendered p{margin-bottom:1.375rem;color:#222;line-height:2.05}
.content-rendered p:last-child{margin-bottom:0}
.content-rendered ul,.content-rendered ol{margin:0 0 1.375rem 0;padding:0}
.content-rendered ul{list-style:none}
.content-rendered ul>li{position:relative;padding-left:1.75rem;margin-bottom:.9375rem;line-height:1.85}
.content-rendered ul>li::before{content:'';position:absolute;left:.25rem;top:.72rem;width:7px;height:7px;border-radius:50%;background:var(--accent);opacity:.8}
.content-rendered ol{list-style:decimal;padding-left:1.75rem}
.content-rendered ol>li{margin-bottom:.9375rem;padding-left:.375rem;line-height:1.85}
.content-rendered li>ul,.content-rendered li>ol{margin-top:.5rem;margin-bottom:.5rem}
.content-rendered li>ul>li::before{width:5px;height:5px;opacity:.5;top:.78rem}
.content-rendered strong{font-weight:700;color:#0a0a0a}
.content-rendered em{font-style:italic;color:var(--text-secondary)}
.content-rendered a{color:var(--accent-dark);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.content-rendered a:hover{color:var(--accent)}
.content-rendered blockquote{background:#f0fdf4;border:1px solid #bbf7d0;border-left:4px solid var(--accent);border-radius:0 var(--radius-sm) var(--radius-sm) 0;padding:1rem 1.25rem;margin:1.5rem 0;color:#166534}
.content-rendered blockquote p{margin-bottom:.5rem;color:#166534;line-height:1.8}
.content-rendered blockquote p:last-child{margin-bottom:0}
/* 섹션 라벨 코드 (무엇이 문제였나요? 등) → 빨간 pill 배지 */
.content-rendered :not(pre)>code{font-family:'Pretendard Variable',Pretendard,-apple-system,BlinkMacSystemFont,sans-serif;font-size:.8125rem;font-weight:700;color:#b91c1c;background:#fef2f2;border:1px solid #fecaca;border-radius:100px;padding:.4375rem 1.25rem;display:inline-block;margin:2.125rem 0 1.125rem;letter-spacing:.01em}
.content-rendered pre{background:#1a1a1a;border-radius:var(--radius-sm);padding:1.25rem 1.5rem;margin:1.5rem 0;overflow-x:auto}
.content-rendered pre code{background:none;border:none;padding:0;color:#e5e5e5;font-size:.8125rem;line-height:1.7;font-weight:400;font-family:'Menlo','Monaco','Cascadia Code','Courier New',monospace;border-radius:0;margin:0;display:inline}
.content-rendered table{width:100%;border-collapse:collapse;margin:1.5rem 0;font-size:.9375rem;border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--border)}
.content-rendered thead{background:var(--surface-hover)}
.content-rendered th{font-weight:600;padding:.75rem 1rem;text-align:left;border-bottom:2px solid var(--border);color:var(--text);font-size:.8125rem;text-transform:uppercase;letter-spacing:.04em}
.content-rendered td{padding:.6875rem 1rem;border-bottom:1px solid var(--border-light);vertical-align:top;color:#2d2d2d;line-height:1.7}
.content-rendered tr:last-child td{border-bottom:none}
.content-rendered tr:hover td{background:rgba(0,0,0,.02)}
.content-rendered hr{border:none;border-top:1px solid var(--border-light);margin:2.5rem 0}
.content-rendered img{max-width:100%;border-radius:var(--radius-sm);margin:1.5rem 0;box-shadow:0 2px 12px rgba(0,0,0,.08);display:block}
