/* ===== 탭 네비게이션 (5개 탭 대응) ===== */
.tab-nav {
  display: flex; gap: 0; margin-bottom: 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(212,168,83,.12);
  border-radius: 14px; overflow: hidden;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; min-width: 0; padding: 12px 4px; text-align: center;
  font-size: 11.5px; font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text-muted);
  background: transparent; border: none; cursor: pointer;
  transition: all .3s; position: relative; white-space: nowrap;
}
.tab-btn.active {
  color: var(--gold);
  background: rgba(212,168,83,.1);
}
.tab-btn.active::after {
  content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
  height: 2px; background: var(--gold); border-radius: 1px;
}
.tab-btn .tab-icon { display: block; font-size: 16px; margin-bottom: 2px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== CARD / FORM ===== */
.card {
  background: linear-gradient(145deg, var(--card-bg-start), var(--card-bg-end));
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 28px 22px; margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  transition: background .4s;
}
.card-title {
  font-family: 'Noto Serif KR', serif; font-size: 18px; font-weight: 700;
  color: var(--gold); text-align: center; margin-bottom: 24px;
}
.card-title::after {
  content: ''; display: block; width: 40px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 10px auto 0;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--gold-light); margin-bottom: 7px;
}
.form-group label .required { color: var(--red); margin-left: 2px; }
.form-input {
  width: 100%; padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px; color: var(--white);
  font-size: 15px; font-family: 'Noto Sans KR', sans-serif;
  transition: all .3s;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus {
  outline: none; border-color: var(--gold);
  background: rgba(212,168,83,.06);
  box-shadow: 0 0 0 3px rgba(212,168,83,.1);
}
.form-input::placeholder { color: rgba(255,255,255,.25); }
[data-theme="light"] .form-input::placeholder { color: rgba(0,0,0,.3); }

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23d4a853' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select.form-input option { background: var(--card-bg-start); color: var(--white); }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.toggle-group { display: flex; gap: 8px; }
.toggle-btn {
  flex: 1; padding: 12px 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px; color: var(--text-muted);
  font-size: 14px; font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer; transition: all .3s; text-align: center;
}
.toggle-btn.active {
  background: linear-gradient(135deg, rgba(212,168,83,.2), rgba(212,168,83,.1));
  border-color: var(--gold); color: var(--gold-light); font-weight: 500;
}
.lunar-option { display: none; margin-top: -10px; margin-bottom: 18px; }
.lunar-option.show { display: block; }
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-row input[type="checkbox"] {
  accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer;
}
.checkbox-row span { font-size: 13px; color: var(--text-muted); }
.time-unknown { margin-top: 8px; }

/* 동의 박스 */
.consent-box {
  margin-top: 22px; padding: 14px 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
}
.consent-box .checkbox-row span { font-size: 12px; line-height: 1.5; }
.consent-box .checkbox-row span a { color: var(--gold); text-decoration: underline; }
.consent-safe {
  display: flex; align-items: center; gap: 5px;
  margin-top: 8px; font-size: 11px; color: #4ade80;
}
.consent-safe svg { width: 14px; height: 14px; fill: #4ade80; flex-shrink: 0; }

.btn-submit {
  width: 100%; padding: 16px; margin-top: 24px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  border: none; border-radius: 14px;
  color: var(--navy); font-size: 17px; font-weight: 700;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer; transition: all .3s;
  position: relative; overflow: hidden;
}
[data-theme="light"] .btn-submit { color: #1a1a2e; }
.btn-submit::before {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  transition: left .5s;
}
.btn-submit:hover::before { left: 100%; }
.btn-submit:disabled {
  background: rgba(212,168,83,.2); color: rgba(255,255,255,.3); cursor: not-allowed;
}
.btn-submit:disabled::before { display: none; }
.btn-submit:not(:disabled):active { transform: scale(.98); }
.btn-submit .spinner {
  display: none; width: 20px; height: 20px;
  border: 2.5px solid var(--navy); border-top-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner { display: block; }

.error-msg {
  display: none; padding: 10px 14px;
  background: rgba(199,62,62,.12); border: 1px solid rgba(199,62,62,.3);
  border-radius: 10px; color: #f87171; font-size: 13px;
  margin-top: 8px; text-align: center;
}
.error-msg.show { display: block; }

/* 모달 */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%; background: rgba(0,0,0,.7);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--card-bg-start); border: 1px solid var(--glass-border);
  border-radius: 16px; max-width: 400px; width: 100%;
  max-height: 70vh; overflow-y: auto; padding: 24px 20px;
}
.modal-box h3 { font-size: 16px; color: var(--gold); margin-bottom: 14px; }
.modal-box p { font-size: 12px; color: var(--text-muted); line-height: 1.8; margin-bottom: 10px; }
.modal-close {
  display: block; width: 100%; margin-top: 16px; padding: 12px;
  background: var(--gold); border: none; border-radius: 10px;
  color: #1a1a2e; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: 'Noto Sans KR', sans-serif;
}

/* ===== 카테고리 탭 공통 ===== */
.cat-intro {
  text-align: center; padding: 10px 0 20px;
  font-size: 13px; color: var(--text-muted); line-height: 1.7;
}
.cat-intro strong { color: var(--gold-light); }
.category-content { padding: 0; }

/* 사주 사전 */
.dict-search-wrap { margin-bottom: 16px; }
.dict-search { font-size: 14px !important; }
.dictionary-list { max-height: 60vh; overflow-y: auto; }
.dict-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(212,168,83,.08);
}
.dict-item:last-child { border-bottom: none; }
.dict-term {
  font-family: 'Noto Serif KR', serif; font-size: 16px;
  font-weight: 700; color: var(--gold); margin-bottom: 4px;
}
.dict-term .dict-hanja {
  font-size: 13px; color: var(--text-muted); font-weight: 400; margin-left: 6px;
}
.dict-desc {
  font-size: 13px; color: rgba(245,240,232,.8); line-height: 1.7;
  word-break: keep-all;
}
.dict-tag {
  display: inline-block; margin-top: 6px; padding: 2px 8px;
  background: rgba(212,168,83,.08); border-radius: 6px;
  font-size: 10px; color: var(--gold-light);
}

/* 명리교실 */
.study-lessons {}
.study-lesson {
  margin-bottom: 12px; border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(212,168,83,.1);
}
.study-lesson-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; cursor: pointer; user-select: none;
}
.study-lesson-header:active { background: rgba(212,168,83,.05); }
.study-lesson-header .sl-num {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 8px; font-size: 14px; font-weight: 900; color: #0a0e27;
  flex-shrink: 0;
}
.study-lesson-header .sl-title {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--gold-light);
}
.study-lesson-header .sl-arrow {
  font-size: 12px; color: var(--text-muted); transition: transform .3s;
}
.study-lesson.open .sl-arrow { transform: rotate(180deg); }
.study-lesson-body {
  max-height: 0; overflow: hidden; transition: max-height .4s ease;
}
.study-lesson.open .study-lesson-body { max-height: 3000px; }
.study-lesson-content {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(212,168,83,.08);
  font-size: 13.5px; line-height: 1.8;
  color: rgba(245,240,232,.85); word-break: keep-all;
}
.study-lesson-content strong { color: var(--gold-light); }
.study-lesson-content .study-example {
  margin: 12px 0; padding: 12px 14px;
  background: rgba(212,168,83,.06);
  border: 1px solid rgba(212,168,83,.1);
  border-radius: 10px; font-size: 12.5px;
}

/* 오늘의 운세 탭 */
.today-day-info {
  text-align: center; padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(212,168,83,.1), rgba(212,168,83,.03));
  border: 1px solid rgba(212,168,83,.15);
  border-radius: 14px;
}
.today-day-info .tdi-date {
  font-family: 'Noto Serif KR', serif; font-size: 18px;
  font-weight: 700; color: var(--gold); margin-bottom: 4px;
}
.today-day-info .tdi-ganzi {
  font-size: 14px; color: var(--gold-light);
}
.today-day-info .tdi-desc {
  font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.6;
}
.today-fortune-item {
  padding: 16px; margin-bottom: 10px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(212,168,83,.08);
  border-radius: 14px;
}
.today-fortune-item .tfi-title {
  font-size: 15px; font-weight: 700; color: var(--gold-light); margin-bottom: 8px;
}
.today-fortune-item .tfi-text {
  font-size: 13px; line-height: 1.75; color: rgba(245,240,232,.8);
}

/* ================================================================
   블로그 형식 콘텐츠 & 에디터
   ================================================================ */

/* 글쓰기 버튼 */
.blog-write-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(212,168,83,.15), rgba(212,168,83,.05));
  border: 1px dashed rgba(212,168,83,.4);
  border-radius: 14px;
  color: var(--gold); font-size: 14px; font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer; transition: all .3s;
}
.blog-write-btn:hover {
  background: rgba(212,168,83,.2);
  border-style: solid;
}
.blog-write-btn .write-icon { font-size: 20px; }

/* 에디터 모달 */
.editor-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.8);
  z-index: 1100;
  padding: 0;
  overflow-y: auto;
}
.editor-overlay.show { display: block; }

.editor-container {
  max-width: 520px; width: 100%;
  margin: 0 auto; min-height: 100vh;
  background: var(--body-bg);
  padding: 0;
  transition: background .4s;
}

/* 에디터 헤더 */
.editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0;
  background: var(--body-bg);
  z-index: 10;
}
.editor-header .eh-back {
  background: none; border: none;
  color: var(--text-muted); font-size: 24px;
  cursor: pointer; padding: 4px 8px;
  font-family: 'Noto Sans KR', sans-serif;
}
.editor-header .eh-title {
  font-size: 16px; font-weight: 700; color: var(--gold);
}
.editor-header .eh-save {
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none; border-radius: 10px;
  color: #0a0e27; font-size: 13px; font-weight: 700;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer; transition: all .2s;
}
.editor-header .eh-save:active { transform: scale(.96); }

/* 에디터 폼 */
.editor-body { padding: 20px; }

.editor-field { margin-bottom: 18px; }
.editor-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--gold-light); margin-bottom: 8px;
}
.editor-input {
  width: 100%; padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px; color: var(--white);
  font-size: 15px; font-family: 'Noto Sans KR', sans-serif;
  transition: all .3s;
}
.editor-input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,83,.1);
}
.editor-textarea {
  width: 100%; min-height: 300px; padding: 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px; color: var(--white);
  font-size: 14.5px; line-height: 1.85;
  font-family: 'Noto Sans KR', sans-serif;
  resize: vertical; transition: all .3s;
}
.editor-textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,83,.1);
}
.editor-textarea::placeholder { color: rgba(255,255,255,.2); }
[data-theme="light"] .editor-textarea::placeholder { color: rgba(0,0,0,.25); }

/* 카테고리 태그 선택 */
.editor-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-tag {
  padding: 7px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  color: var(--text-muted); font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer; transition: all .3s;
}
.editor-tag.selected {
  background: rgba(212,168,83,.15);
  border-color: var(--gold);
  color: var(--gold-light); font-weight: 600;
}

/* 에디터 툴바 (간단 서식) */
.editor-toolbar {
  display: flex; gap: 4px; margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(212,168,83,.08);
  border-radius: 10px;
}
.toolbar-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 8px;
  color: var(--text-muted); font-size: 15px;
  font-family: 'Noto Serif KR', serif;
  cursor: pointer; transition: all .2s;
  font-weight: 700;
}
.toolbar-btn:hover { background: rgba(212,168,83,.1); color: var(--gold-light); }
.toolbar-btn.active { background: rgba(212,168,83,.15); color: var(--gold); }
.toolbar-sep {
  width: 1px; margin: 4px 2px;
  background: rgba(212,168,83,.1);
}

/* ================================================================
   블로그 포스트 카드
   ================================================================ */
.blog-post-list { }

.blog-post-card {
  background: linear-gradient(145deg, var(--card-bg-start), var(--card-bg-end));
  border: 1px solid var(--glass-border);
  border-radius: 18px; margin-bottom: 16px;
  overflow: hidden; cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.blog-post-card:hover {
  border-color: rgba(212,168,83,.4);
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
.blog-post-card:active { transform: scale(.99); }

/* 썸네일 (선택사항) */
.bpc-thumbnail {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, rgba(212,168,83,.1), rgba(212,168,83,.03));
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  border-bottom: 1px solid rgba(212,168,83,.08);
}

.bpc-body { padding: 20px; }

.bpc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bpc-tag {
  padding: 3px 10px;
  background: rgba(212,168,83,.1);
  border-radius: 6px; font-size: 10px;
  color: var(--gold-light); font-weight: 600;
}

.bpc-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 17px; font-weight: 700;
  color: var(--gold-light); line-height: 1.5;
  margin-bottom: 10px;
}

.bpc-excerpt {
  font-size: 13.5px; line-height: 1.75;
  color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  word-break: keep-all;
}

.bpc-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid rgba(212,168,83,.06);
}
.bpc-date { font-size: 11px; color: var(--text-muted); }
.bpc-read-more {
  font-size: 12px; color: var(--gold); font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}

/* ================================================================
   블로그 글 상세 보기
   ================================================================ */
.blog-detail-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.8);
  z-index: 1100; overflow-y: auto;
}
.blog-detail-overlay.show { display: block; }

.blog-detail-container {
  max-width: 520px; width: 100%;
  margin: 0 auto; min-height: 100vh;
  background: var(--body-bg);
}
.blog-detail-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0;
  background: var(--body-bg); z-index: 10;
}
.blog-detail-header .bdh-back {
  background: none; border: none;
  color: var(--text-muted); font-size: 22px;
  cursor: pointer; padding: 4px;
}
.blog-detail-header .bdh-title {
  font-size: 14px; color: var(--gold-light); font-weight: 600;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.blog-detail-header .bdh-delete {
  background: none; border: none;
  color: rgba(248,113,113,.6); font-size: 13px;
  cursor: pointer; font-family: 'Noto Sans KR', sans-serif;
  padding: 6px 12px;
}
.blog-detail-header .bdh-delete:hover { color: #f87171; }

.blog-detail-body { padding: 24px 20px; }

.blog-detail-body .bd-category {
  display: inline-block; padding: 4px 12px;
  background: rgba(212,168,83,.1); border-radius: 8px;
  font-size: 11px; color: var(--gold); font-weight: 600;
  margin-bottom: 14px;
}
.blog-detail-body .bd-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 22px; font-weight: 700;
  color: var(--gold-light); line-height: 1.5;
  margin-bottom: 12px;
}
.blog-detail-body .bd-meta {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid rgba(212,168,83,.08);
}
.blog-detail-body .bd-content {
  font-size: 15px; line-height: 2;
  color: rgba(245,240,232,.88);
  word-break: keep-all;
}
.blog-detail-body .bd-content p { margin-bottom: 18px; }
.blog-detail-body .bd-content strong { color: var(--gold-light); }
.blog-detail-body .bd-content blockquote {
  margin: 20px 0; padding: 16px 20px;
  background: rgba(212,168,83,.06);
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  font-style: italic; color: var(--gold-light);
}
.blog-detail-body .bd-content h2 {
  font-family: 'Noto Serif KR', serif;
  font-size: 18px; font-weight: 700;
  color: var(--gold); margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,168,83,.1);
}
.blog-detail-body .bd-content h3 {
  font-size: 16px; font-weight: 700;
  color: var(--gold-light); margin: 22px 0 10px;
}

/* 빈 상태 */
.blog-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.blog-empty .be-icon { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.blog-empty .be-text { font-size: 14px; line-height: 1.7; }
.blog-empty .be-text strong { color: var(--gold-light); }

/* 카테고리 필터 */
.blog-filter {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.blog-filter-btn {
  padding: 7px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(212,168,83,.1);
  border-radius: 20px;
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer; transition: all .3s;
}
.blog-filter-btn.active {
  background: rgba(212,168,83,.12);
  border-color: rgba(212,168,83,.35);
  color: var(--gold-light); font-weight: 600;
}
.blog-filter-btn .filter-count {
  display: inline-block; margin-left: 4px;
  padding: 1px 6px; border-radius: 10px;
  background: rgba(212,168,83,.15);
  font-size: 10px; color: var(--gold);
}
