* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6b4c3b;
  --primary-hover: #5a3d2f;
  --accent: #e8a87c;
  --bg: #faf7f4;
  --card-bg: #ffffff;
  --text: #2c1f14;
  --text-light: #7a6558;
  --border: #e8ddd5;
  --star: #f0a500;
  --danger: #c0392b;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

img, input, textarea, select {
  max-width: 100%;
}

.hidden { display: none !important; }
.loading { text-align: center; padding: 3rem; color: var(--text-light); }

/* ── 헤더 ───────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top-bar {
  background: var(--primary);
  padding: 0 1.5rem;
}

.header-bottom-bar {
  background: var(--bg);
  padding: 0.45rem 1.5rem;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.header-bottom {
  display: flex;
  justify-content: flex-end;
}

.header-logo {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.username-badge {
  color: #fde8d5;
  font-size: 0.9rem;
}

.btn-logout {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ── 알림 ───────────────────── */
.notif-wrap { position: relative; }
.notif-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  color: #fff;
  width: 36px;
  height: 32px;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.notif-btn:hover { background: rgba(255,255,255,0.25); }
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  width: 280px;
  z-index: 200;
  overflow: hidden;
}
.notif-header {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }
.notif-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.notif-text { font-size: 0.83rem; color: var(--text); line-height: 1.4; }
.notif-text strong { font-weight: 700; }
.notif-time { font-size: 0.72rem; color: var(--text-light); margin-top: 0.1rem; }
.notif-unread { background: #fef9f0; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--text-light); font-size: 0.85rem; }

/* ── 회원 검색 ──────────────── */
.user-search-wrap {
  position: relative;
}
.user-search-input {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  width: 280px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.user-search-input::placeholder { color: var(--text-light); }
.user-search-input:focus { border-color: var(--accent); }
.user-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  width: 260px;
  z-index: 200;
  overflow: hidden;
}
.user-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.user-search-item:last-child { border-bottom: none; }
.user-search-item:hover { background: var(--bg); }
.user-search-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.user-search-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.user-search-handle { font-size: 0.75rem; color: var(--text-light); margin-top: 0.1rem; }
.user-search-empty { padding: 1rem; text-align: center; color: var(--text-light); font-size: 0.85rem; }

/* ── 로그인/회원가입 ─────────── */
.auth-page {
  background: linear-gradient(135deg, #faf0e6 0%, #ede0d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-container {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(107,76,59,0.15);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.auth-logo h1 {
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: 800;
}

.auth-logo p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.oauth-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.oauth-btn:active { transform: translateY(0); }

.oauth-kakao {
  background: #FEE500;
  color: #191919;
}

.oauth-naver {
  background: #03C75A;
  color: #fff;
}

.naver-n {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

.tab-buttons {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 500;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

/* ── 공통 폼 ─────────────────── */
.auth-form, .input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-form { gap: 1rem; }

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.input-group input,
.input-group textarea,
.input-group select {
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border 0.2s;
  font-family: inherit;
  resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.required { color: #e74c3c; }

.date-range-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.date-input {
  flex: 1;
  padding: 0.7rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  font-family: inherit;
  transition: border 0.2s;
}
.date-input:focus { outline: none; border-color: var(--primary); }
.date-input:disabled { background: #f5f0eb; color: #bbb; }

.date-tilde {
  color: var(--text-light);
  font-weight: 600;
  flex-shrink: 0;
}

.oneday-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}
.oneday-check input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.error-msg {
  color: #e74c3c;
  font-size: 0.85rem;
  min-height: 1rem;
}

/* ── 버튼 ─────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1.5px solid var(--border);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ── 대시보드 ─────────────────── */
/* ── 사이드바 레이아웃 ──────────── */
.page-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 180px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  align-self: flex-start;
}

.sidebar {
  width: 180px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.book-filter-input { width: 200px; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: var(--bg); color: var(--text); }
.sidebar-item.active { background: #f5ede8; color: var(--primary); }
.sidebar-icon { font-size: 1rem; }

.dashboard {
  flex: 1;
  min-width: 0;
}

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.btn-add {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-add:hover { background: #d4946a; }

/* ── Kakao 배너 ────────────────── */
.kakao-banner {
  background: #fffbea;
  border-bottom: 1px solid #f0e68c;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
  color: #7a6320;
}

.kakao-banner span { flex: 1; }

.banner-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--primary);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.82rem;
}
.banner-link:hover { background: var(--primary); color: #fff; }

.banner-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 1rem;
  padding: 0;
}

/* ── 책 그리드 ─────────────────── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.book-cover {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: linear-gradient(135deg, #f5ebe0, #e8d5c4);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.book-info {
  padding: 0.9rem;
}

.book-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.book-author {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.book-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

.book-stars .star, .detail-stars .star {
  color: #ddd;
  font-size: 0.95rem;
}
.book-stars .star.active, .detail-stars .star.active {
  color: var(--star);
}

/* ── 빈 상태 ──────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 260px);
  padding: 2rem;
  color: var(--text-light);
}

.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-state small { font-size: 0.9rem; }

/* ── 모달 ─────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.2rem;
}

.modal form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ── 이미지 업로드 영역 ────────── */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.image-upload-area:hover { border-color: var(--primary); }

.image-upload-area img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
}

#uploadPlaceholder, #editUploadPlaceholder {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.upload-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
#uploadPlaceholder p, #editUploadPlaceholder p { font-size: 0.95rem; }
#uploadPlaceholder small, #editUploadPlaceholder small { font-size: 0.8rem; }

/* ── 별점 ─────────────────────── */
.star-rating {
  display: flex;
  gap: 4px;
  font-size: 1.6rem;
  cursor: pointer;
}

.star-rating span {
  color: #ddd;
  transition: color 0.1s;
  user-select: none;
}
.star-rating span.active { color: var(--star); }

/* ── 책 검색 ──────────────────── */
/* ── 느낀점 작성 페이지 ─────────── */
.review-page-body {
  background: #f4f0eb;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.review-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.5rem;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.review-back {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.review-back:hover { color: #fff; }

.review-topbar-title {
  flex: 1;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.review-save-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
  padding: 0.4rem 1.1rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.review-save-btn:hover { background: rgba(255,255,255,0.35); }
.review-save-btn:disabled { opacity: 0.6; cursor: default; }

/* 에디터 툴바 */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toolbar-btn {
  padding: 0.3rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  transition: all 0.15s;
  line-height: 1.2;
}
.toolbar-btn:hover { border-color: var(--primary); color: var(--primary); }
.toolbar-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.toolbar-btn-i { font-style: italic; }
.toolbar-btn-u { text-decoration: underline; }

.toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 0.2rem;
}

.size-btns {
  display: flex;
  gap: 0.2rem;
}

.toolbar-size-btn {
  padding: 0.25rem 0.55rem;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-light);
  transition: all 0.15s;
}
.toolbar-size-btn:hover { border-color: var(--primary); color: var(--primary); }
.toolbar-size-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.toolbar-img-btn {
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* 에디터 본문 */
.editor-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
}

.editor-paper {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  min-height: calc(100vh - 200px);
  padding: 2.5rem 3rem;
}

@media (max-width: 600px) {
  .editor-paper { padding: 1.5rem 1.2rem; }
}

.review-title-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
  padding: 0;
  background: transparent;
}

.review-title-input::placeholder {
  color: #ccc;
  font-weight: 400;
}

.review-divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 1.2rem 0;
}

.review-title-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.editor-content {
  min-height: 400px;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.editor-content:empty::before {
  content: attr(data-placeholder);
  color: #ccc;
  pointer-events: none;
}

/* execCommand fontSize 태그 스타일 */
.editor-content font[size="1"] { font-size: 0.7rem; }
.editor-content font[size="2"] { font-size: 0.85rem; }
.editor-content font[size="3"] { font-size: 0.95rem; }
.editor-content font[size="4"] { font-size: 1.1rem; }
.editor-content font[size="5"] { font-size: 1.4rem; }
.editor-content font[size="6"] { font-size: 1.8rem; }
.editor-content font[size="7"] { font-size: 2.2rem; }

/* 에디터 내 이미지 */
.editor-content img, .review-img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
  display: block;
  cursor: default;
}

/* 저장 토스트 */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 500;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── 책 검색 ──────────────────── */
.search-section {
  position: relative;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
}

.search-bar input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border 0.2s;
  font-family: inherit;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-search {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-search:hover { background: var(--primary-hover); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 300;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f5f0eb;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #fdf7f3; }

.search-thumb {
  width: 40px;
  height: 55px;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5ebe0, #e8d5c4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
}
.search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-info { flex: 1; min-width: 0; }
.search-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-author {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 2px;
}

.search-loading, .search-empty {
  text-align: center;
  padding: 1.2rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-light);
  font-size: 0.8rem;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 책 상세 ──────────────────── */
.book-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.back-btn-wrap { margin-bottom: 1.5rem; }

.back-btn {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}
.back-btn:hover { text-decoration: underline; }

.detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 2rem;
}

@media (max-width: 680px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-cover { max-width: 220px; margin: 0 auto; }
}

.detail-cover {
  flex-shrink: 0;
}

.cover-img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: block;
}

.detail-cover-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #f5ebe0, #e8d5c4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.detail-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.detail-author {
  color: var(--text-light);
  font-size: 1rem;
  margin-top: 0.3rem;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-edit, .btn-delete {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-edit {
  background: #f0e6dc;
  color: var(--primary);
}
.btn-edit:hover { background: #e8d5c4; }

.btn-delete {
  background: #fde8e8;
  color: var(--danger);
}
.btn-delete:hover { background: #f5c6c6; }

.detail-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-stars { font-size: 1.3rem; }

.detail-date {
  color: var(--text-light);
  font-size: 0.9rem;
}

.review-section { flex: 1; }

.review-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.review-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 1.2rem;
  min-height: 120px;
}

.review-text {
  line-height: 1.8;
  color: var(--text);
  font-size: 0.95rem;
}

.review-empty {
  color: var(--text-light);
  font-size: 0.9rem;
  font-style: italic;
}

.review-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.review-label { margin-bottom: 0; }

.btn-review-edit {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-review-edit:hover { border-color: var(--primary); color: var(--primary); }

.review-box {
  cursor: pointer;
  transition: background 0.15s;
}
.review-box:hover { background: #f0e8e0; }

.review-edit-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-edit-wrap textarea {
  width: 100%;
  padding: 1rem;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.8;
  resize: vertical;
  color: var(--text);
  background: #fff;
}
.review-edit-wrap textarea:focus { outline: none; }

.review-edit-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.created-at {
  font-size: 0.8rem;
  color: #bbb;
  margin-top: auto;
}

/* ── 햄버거 메뉴 / 슬라이드 드로어 ─── */
.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem 0.2rem 0;
}

.drawer-overlay {
  display: none;
}

/* ── 모바일 대응 ──────────────── */
@media (max-width: 768px) {
  .menu-toggle-btn { display: inline-block; }

  .header-inner { padding: 0 0.35rem; }
  .header-top { height: auto; padding: 0.5rem 0; gap: 0.4rem; flex-wrap: nowrap; }
  .header-logo { font-size: 0.95rem; white-space: nowrap; flex-shrink: 0; }
  .header-right { gap: 0.35rem; flex-wrap: nowrap; flex-shrink: 0; }
  .username-badge { display: none; }
  .notif-btn { width: 30px; height: 28px; font-size: 0.85rem; flex-shrink: 0; }
  .btn-logout { white-space: nowrap; font-size: 0.75rem; padding: 0.3rem 0.55rem; flex-shrink: 0; }
  .header-bottom-bar { padding: 0.45rem 0.35rem; }
  .header-bottom { gap: 0.5rem !important; flex-wrap: nowrap; }
  .user-search-input, .book-filter-input { width: auto; flex: 1; min-width: 0; }
  .user-search-wrap { flex: 1; min-width: 0; }
  .user-search-results, .notif-dropdown { width: 90vw; max-width: 320px; right: -0.5rem; }

  .page-layout { flex-direction: column; align-items: stretch; padding: 1.2rem 1rem; gap: 1rem; }

  /* 사이드바 = 슬라이드 드로어 */
  #sidebarDrawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 50%;
    min-width: 200px;
    max-width: 320px;
    background: var(--bg);
    z-index: 400;
    padding: 1.2rem 0.9rem;
    box-shadow: 2px 0 24px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  #sidebarDrawer.open { transform: translateX(0); }

  .drawer-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 390;
  }

  .sidebar { width: 100%; }
  .sidebar-item { width: 100%; white-space: normal; }

  .book-grid { grid-template-columns: 1fr; }

  .auth-container { padding: 1.8rem 1.5rem; }
  .book-detail { padding: 1.2rem 1rem; }
  .detail-layout { padding: 1.2rem; gap: 1.5rem; }
  .editor-wrapper { padding: 1.2rem 1rem; }
  .modal-body, .modal form { padding: 1.1rem; }
}

@media (min-width: 769px) {
  .drawer-overlay { display: none !important; }
}
