# 퍼블리싱 룰 — MCP Plugin (모바일 금융 앱)

> 모든 HTML 퍼블리싱은 이 룰을 기준으로 작성합니다.

---

## 1. 화면 기본 구조

```html
<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>페이지 타이틀</title>
  <link rel="stylesheet" href="../src/css/reset.css">
  <link rel="stylesheet" href="../src/css/common.css">
</head>
<body>
<div class="screen">
  <header> ... </header>
  <!-- 콘텐츠 -->
</div>
<script src="../src/js/common.js"></script>
</body>
</html>
```

---

## 2. 헤더

### 상세 페이지 (뒤로가기 + 중앙 타이틀)
```css
.pg_header {
  position: sticky; top: 0; z-index: 50;
  height: 55px; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.btn_back {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pg_title { font-size: 17px; font-weight: 500; color: #000; line-height: 25px; }
.btn_icon_r {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
```
- 뒤로가기 SVG: `<path d="M7 1L1 7L7 13" stroke="#000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>` (8×14 viewBox)
- 우측 아이콘: 인라인 SVG 사용 (이미지 파일 없음)

### 메인 페이지 (탭바 포함)
- 헤더 55px + 탭바 40px = 전체 95px
- 모든 CSS는 `common.css`에 정의됨 — 페이지 내 `<style>` 작성 불필요
- HTML 구조 및 클래스 상세는 **CLAUDE.md `헤더 타입 > 메인 페이지`** 참고

---

## 3. 레이아웃 & 간격

- 좌우 padding: **20px** (`--page_side: 20px`)
- 고정 width 금지 → 유동 레이아웃
- 하단 여백: `padding-bottom: 32px`

### 섹션 패딩 패턴
```css
.summary_wrap    { padding: 20px 20px 0; }     /* 상단 타이틀 영역 */
.detail_wrap     { padding: 20px 20px 32px; }   /* 상세 본문 */
.tx_list_wrap    { padding: 20px 20px 32px; }   /* 거래내역 */
.list_wrap       { padding: 20px 20px 32px; }   /* 목록 */
```

### 구분선 (division_line)

케이스에 따라 margin이 다름 — 둘 중 하나만 선택해서 작성.

```css
/* 케이스 1: 좌우 padding 안에 있을 때 (padding -20px으로 튀어나오게) */
.division_line { height: 10px; background: #f7f7f7; margin: 20px -20px 0; }

/* 케이스 2: 전체 너비 컨테이너 직하위일 때 */
.division_line { height: 10px; background: #f7f7f7; margin: 20px 0 0; }
```

---

## 4. 컬러 변수

```css
--color_primary:      #5628EE   /* 브랜드 보라색 */
--color_primary_sub:  #6F3CFF   /* 차트 활성 바 */
--color_black:        #000000
--color_gray2:        #666666
--color_gray3:        #777777
--color_bg:           #ffffff
--color_bg_gray:      #f2f2f2
--color_border:       #eeeeee
--color_border_dark:  #dddddd
--color_cyan:         #06BEE1
--color_cyan_dark:    #0092AE
```

> **컬러 용도 구분**
> - `#5628EE` (`--color_primary`): 브랜드 기본 컬러, 버튼, 섹션 타이틀(간소화 화면)
> - `#5831D7`: 소비목록 그룹 카운트, 상세 페이지 섹션 타이틀(기본정보/납입정보/담보정보 등)
> - `#cb2b11`: 특약정보 섹션 타이틀

---

## 5. 타이포그래피

| 용도 | 크기 | 굵기 | 줄높이 | 색상 |
|---|---|---|---|---|
| 화면 상단 대제목 | 21px | 500 | 31px | #000 |
| 금액 (대) | 25px | 500 | 28px | #000 (Roboto) |
| 소비 목록 금액 | 20px | 500 | 25px | #000 (Roboto) |
| 섹션 타이틀 | 17~18px | 500 | 25px | #5831D7 또는 #5628EE |
| 일반 행 라벨 | 17px | 500 | 25px | #666 |
| 일반 행 값 | 17px | 500 | 25px | #000 |
| 상품명 | 15px | 500 | 22px | #666 |
| 거래 유형 | 15px | 500 | 22px | #000 |
| 서브 텍스트 | 14px | 500 | 19~21px | #666 |
| 뱃지 | 11px | 500 | 15px | (뱃지별 색상) |
| 헤더 타이틀 | 17px | 500 | 25px | #000 |

### 폰트
- 기본: `Spoqa Han Sans Neo` (로컬 woff2)
- 금액/숫자: `Roboto`

---

## 6. 뱃지 (Badge)

```css
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; padding: 3px 5px;
  font-size: 11px; font-weight: 500; line-height: 15px; white-space: nowrap;
}
```

| 클래스 | 배경 | 글자색 | 용도 |
|---|---|---|---|
| `badge_blue` | `rgba(58,99,195,0.15)` | `#3a63c3` | 본인납부 |
| `badge_green` | `rgba(13,178,110,0.15)` | `#0db26e` | 정상 |
| `badge_gray` | `rgba(66,66,66,0.15)` | `#777` | 실효 |
| `badge_red` | `rgba(215,24,32,0.1)` | `#d71820` | 만기/소멸 |
| `rate_badge` | `rgba(215,24,32,0.1)` | `#d71820` | 적용금리 |

---

## 7. 토글 스위치

```html
<div class="toggle_track"><div class="toggle_thumb"></div></div>
```
```css
.toggle_track {
  width: 40px; height: 22px; background: var(--color_primary); border-radius: 12px;
  position: relative;
}
.toggle_thumb {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
}
```

---

## 8. List typeC (키-값 행)

```html
<div class="row_c">
  <span class="row_label">라벨</span>
  <span class="row_val">값</span>
</div>
```
```css
.row_c { display: flex; justify-content: space-between; align-items: center; height: 25px; }
.row_label { font-size: 17px; font-weight: 500; color: #666; line-height: 25px; }
.row_val   { font-size: 17px; font-weight: 500; color: #000; line-height: 25px; text-align: right; }
```

---

## 9. List typeD (키-값+화살표 행)

```html
<div class="row_d">
  <span class="row_label">담보</span>
  <div class="row_d_right">
    <span class="row_d_val">30개</span>
    <svg width="12" height="12" viewBox="0 0 12 12" fill="none">
      <path d="M4 2l4 4-4 4" stroke="#424242" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
    </svg>
  </div>
</div>
```
```css
.row_d       { display: flex; justify-content: space-between; align-items: center; height: 25px; }
.row_d_right { display: flex; gap: 6px; align-items: center; }
.row_d_val   { font-size: 17px; font-weight: 500; color: #000; line-height: 25px; }
```

---

## 10. 보험 목록 아이템

```html
<div class="item_inner">
  <div class="badge_row">  <!-- 뱃지 있을 때만 -->
    <span class="badge badge_blue">본인납부</span>
    <span class="badge badge_green">정상</span>
  </div>
  <div class="item_main">
    <div class="item_left">
      <!-- 로고 이미지 있을 때 -->
      <div class="item_logo"><img src="../assets/images/logo-hanwha.png" alt="한화생명"></div>
      <!-- 로고 이미지 없을 때 (텍스트 폴백) -->
      <div class="item_logo" style="background:#e4002b;"><span>현대</span></div>
      <div class="item_text">
        <span class="item_name">보험 상품명</span>
        <span class="item_amt">359,153,000원</span>
      </div>
    </div>
  </div>
</div>
```
```css
.item_inner  { display: flex; flex-direction: column; gap: 8px; }
.badge_row   { padding-left: 42px; display: flex; gap: 8px; align-items: flex-start; }
.item_main   { display: flex; align-items: center; }
.item_left   { flex: 1; display: flex; gap: 12px; align-items: center; min-width: 0; }
.item_logo   {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.item_logo img  { width: 100%; height: 100%; object-fit: cover; }
.item_logo span { font-size: 7px; font-weight: 700; color: #fff; }
.item_name   { font-size: 15px; font-weight: 500; color: #666; line-height: 22px; }
.item_amt    { font-size: 20px; font-weight: 500; color: #000; line-height: 25px; font-family: 'Roboto', sans-serif; }
```

---

## 11. 거래내역 행 (보험/보증 타입)

```html
<div class="tx_row">
  <div class="tx_left">
    <span class="tx_type">보험료납입</span>
    <span class="tx_round">1회차</span>
  </div>
  <div class="tx_right">
    <span class="tx_amount">-300,000원</span>
    <span class="tx_method">자동이체</span>
  </div>
</div>
```
```css
.tx_row    { display: flex; justify-content: space-between; align-items: center; }
.tx_left   { display: flex; flex-direction: column; gap: 3px; }
.tx_type   { font-size: 15px; font-weight: 500; color: #000; line-height: 22px; }
.tx_round  { font-size: 14px; font-weight: 500; color: #666; line-height: 19px; }
.tx_right  { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tx_amount { font-size: 17px; font-weight: 500; color: #000; line-height: 22px; }
.tx_method { font-size: 14px; font-weight: 500; color: #666; line-height: 19px; }
```

---

## 12. 날짜/연도 네비게이션

```html
<div class="date_filter_row">
  <div class="month_nav">
    <button class="arr_btn">← SVG</button>
    <span class="month_text">2022년</span>
    <button class="arr_btn">→ SVG</button>
  </div>
  <button class="filter_btn">필터 SVG</button>
</div>
```
```css
.date_filter_row {
  position: relative; width: 226px; height: 25px;
  margin-left: auto; margin-bottom: 30px;
}
.month_nav {
  position: absolute; left: 0; top: 1px;
  display: flex; gap: 20px; align-items: center;
}
.arr_btn   { width: 16px; height: 16px; background: none; border: none; padding: 0; cursor: pointer; }
.month_text { font-size: 17px; font-weight: 500; color: #666; line-height: 22px; }
.filter_btn {
  position: absolute; left: 201px; top: 0;
  width: 25px; height: 25px; background: none; border: none; padding: 0; cursor: pointer;
}
```

---

## 13. 버튼

### 추가 버튼 (btn_more)
```css
.btn_more {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #ddd; border-radius: 6px;
  padding: 11px 10px 12px;
  font-size: 15px; font-weight: 500; color: #424242;
  background: none; width: 100%; cursor: pointer;
}
```

### 거래내역 조회 버튼
```css
.btn_tx {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #ddd; border-radius: 6px;
  height: 45px;
  font-size: 15px; font-weight: 500; color: #424242;
  background: none; width: 100%; cursor: pointer;
}
```

### 이체 버튼 (btn_잔액 타입)
```css
.btn_transfer {
  width: 53px; height: 44px; background: #f2f2f2; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: #424242;
  line-height: 44px; text-align: right; padding-right: 15px;
  cursor: pointer; display: block;
}
```

---

## 14. 카드 스타일

### 소비 요약 / 순위 카드
```css
background: #ffffff;
border-radius: 12px;
border: 1px solid #eeeeee;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.06);
padding: 20px;
```

### 소비 목록 카드 (카드/페이)
```css
background: #ffffff;
border-radius: 12px;
border: 1px solid #dddddd;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.06);
padding: 20px; gap: 20px;
```

### 소비 목록 카드 (입출금/대출/보험)
```css
background: #ffffff;
border-radius: 8px;
border: 1px solid #dddddd;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
padding: 20px; gap: 20px;
```

---

## 15. 소비 목록 그룹 (소비 메인)

```css
.spend_group_name  { font-size: 17px; font-weight: 500; color: #000; }
.spend_group_count { font-size: 17px; font-weight: 500; color: #5831D7; }
.spend_group_total { font-size: 17px; font-weight: 500; color: #000; }
.spend_item        { height: 50px; }
.spend_item_logo   { width: 30px; height: 30px; }
.spend_item_name   { font-size: 15px; color: #666; }
.spend_item_amount { font-size: 20px; color: #000; font-family: 'Roboto'; }
```

---

## 16. 소비 차트

```css
/* 비활성 바 */   background: #eee;
/* 활성 바 */     background: #6F3CFF;
/* 바 크기 */     width: 30px; border-radius: 8px 8px 0 0;
/* 바 간격 */     gap: 20px;
```

| 클래스 | 높이 |
|---|---|
| `bar_h_90` | 90px |
| `bar_h_70` | 70px |
| `bar_h_60` | 60px |
| `bar_h_50` | 50px |
| `bar_h_40` | 40px |
| `bar_h_30` | 30px |

---

## 17. 아이콘 화살표

> `ic-arrow-next.svg`와 `ic-arrow-s-next.svg` 모두 SVG 원본이 위(∧) 방향
> → **사용하는 모든 클래스에 반드시 `transform: rotate(90deg)` 추가**

```css
/* ic-arrow-next.svg 사용 예 (16px) */
.notice_banner_arrow  { width: 16px; height: 16px; transform: rotate(90deg); }

/* ic-arrow-s-next.svg 사용 예 (12px) */
.spend_group_arrow_s  { width: 12px; height: 12px; transform: rotate(90deg); }
```

> common.css에 정의된 기존 클래스들은 모두 적용되어 있음.
> 신규 클래스 작성 시 누락 주의.

---

## 18. 섹션 헤더 (타이틀 + 카운트)

소비 조회 목록(N7000, N3000 등) 섹션 제목 패턴.

```html
<div class="section_title">
  <span class="section_name">저축보험</span>
  <span class="section_count">2</span>
</div>
```
```css
.section_title { display: flex; gap: 8px; align-items: center; }
.section_name  { font-size: 18px; font-weight: 500; color: #000; line-height: 27px; }
.section_count { font-size: 20px; font-weight: 500; color: #5831D7; line-height: 25px; }
```

---

## 19. 카드 이미지 아이템 (선불카드/카드 목록)

```html
<!-- 카드 목록 (N3000 스타일) — 30×44px 카드 썸네일 -->
<div class="card_list_item">
  <img class="card_list_logo" src="../assets/images/logo-card-1.png" alt="BNK 탑모아">
  <div class="card_list_info">
    <span class="card_list_name">BNK 탑모아 신용카드</span>
    <div class="card_list_amt_row">
      <span class="card_list_amt">359,153,000원</span>
    </div>
  </div>
</div>

<!-- 선불카드 목록 (N4000 스타일) — item_logo_card -->
<div class="item_row">
  <img src="../assets/images/logo-card-2.png" class="item_logo_card" alt="Pre-i 선불카드">
  <div class="item_info">
    <span class="item_name">Pre-i 선불카드</span>
  </div>
</div>
```
```css
.card_list_logo  { width: 30px; height: 44px; object-fit: cover; flex-shrink: 0; }
.item_logo_card  { width: 30px; height: 44px; border-radius: 4px; flex-shrink: 0; }
```

---

## 20. 프로그레스 바 (대출 상환율)

```html
<div class="progress_wrap">
  <div class="progress_balloon">80% 상환했어요.</div>
  <div class="progress_bar_bg"></div>
  <div class="progress_bar_fill" style="width:80%;"></div>
</div>
```
```css
.progress_wrap     { position: relative; height: 65px; }
.progress_bar_bg   { position: absolute; bottom: 0; left: 0; right: 0; height: 12px; background: #f2f2f2; border-radius: 10px; }
.progress_bar_fill { position: absolute; bottom: 0; left: 0; height: 12px; background: #ff6161; border-radius: 10px; }
.progress_balloon  {
  position: absolute; right: 0; top: 0;
  background: #fff; border: 1px solid #ddd; border-radius: 8px;
  padding: 4px 10px; font-size: 14px; font-weight: 400; color: #000;
  white-space: nowrap;
}
.progress_balloon::after {
  content: ''; position: absolute; bottom: -7px; right: 20px;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid #ddd;
}
```
> `width:xx%` 는 데이터 값이므로 인라인 스타일 허용

---

## 21. Dot Indicator (잔여/환산 구분점)

```html
<span class="info_label">
  <span class="dot_indicator dot_blue"></span>잔여대출잔액
</span>
<span class="info_label">
  <span class="dot_indicator dot_gray"></span>환산금액
</span>
```
```css
.dot_indicator { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; margin-right: 4px; }
.dot_blue      { background: #5628EE; }
.dot_gray      { background: #f2f2f2; border: 1px solid #ddd; }
```

---

## 22. 이미지 경로

```
../assets/images/
│
├── [아이콘]
│   ├── ic-arrow-next.svg       ← 오른쪽 화살표 (SVG 원본이 위(∧) 방향 — rotate(90deg) 필수)
│   ├── ic-arrow-s-next.svg     ← 작은 오른쪽 화살표 (동일하게 rotate(90deg) 필수)
│   ├── ic-close.svg
│   ├── ic-nav-calendar.png
│   ├── ic-nav-my.png
│   └── ic-emoji-fire/smile/sad/eyes.svg
│
├── [공통 이미지]
│   └── img-question-3d.svg     ← 도움말/물음표 3D 이미지 (소비 없음 빈 화면 등)
│
├── [회사 로고 — 원형 30px]
│   ├── logo-bnk.png            은행/대출 (BNK경남은행)
│   ├── logo-kb.png             KB국민
│   ├── logo-hana.png           하나
│   ├── logo-kakao.png          카카오페이/카카오뱅크
│   ├── logo-naver.png          네이버페이
│   ├── logo-samsung.png        삼성카드/삼성생명
│   ├── logo-shin.png           신한은행/신한카드
│   ├── logo-shin-ins.png       신한생명보험 (은행 로고와 별도)
│   ├── logo-woori.png          우리
│   ├── logo-lotte.png          롯데
│   ├── logo-sk.png             SK
│   ├── logo-2030.png           BNK 2030통장
│   ├── logo-hanwha.png         한화생명/한화손해보험
│   ├── logo-db.png             DB손해보험
│   └── logo-sgi.png            SGI서울보증보험
│
└── [카드 이미지 — 30×44px]
    ├── logo-card-1.png         카드 디자인 1 (초록)
    ├── logo-card-2.png         카드 디자인 2 (빨강)
    └── logo-card-3.png         카드 디자인 3 (다크)
```

> 상세 페이지 헤더 아이콘은 이미지 파일 없이 **인라인 SVG** 사용

---

## 23. 금지 사항

- `style=""` **레이아웃 목적** 인라인 스타일 금지 (예외: 데이터 값으로 결정되는 `width:80%`, 로고 없는 항목의 `background:#xxx` 폴백은 허용)
- `width: 360px` 등 고정 픽셀 너비 금지
- CDN 외부 이미지 URL 금지 (피그마 API asset URL 포함)
- Google Fonts import 금지 (로컬 Spoqa Han Sans Neo 사용)
- 피그마 확인 없이 수치 추측 금지
