/* =========================================================
   강의 작품 갤러리 — 디자인 시스템 (Samsung 스타일)
   블랙 & 화이트 미니멀 + Samsung Blue 액센트 · 플랫 · 프리미엄
   ========================================================= */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e4e4e6;
  --border-strong: #c9c9cd;

  --text: #121212;
  --text-2: #555559;
  --text-3: #8e8e93;

  --black: #000000;
  --black-hover: #2b2b2e;

  --blue: #1428a0;          /* Samsung Blue */
  --blue-hover: #0e1d78;
  --blue-bright: #1d4ed8;
  --blue-soft: #eef1fb;
  --blue-ring: rgba(20, 40, 160, 0.16);

  --like: #1428a0;
  --like-soft: #eef1fb;

  --danger: #d11f33;
  --danger-soft: #fdecee;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.14);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* hidden 속성은 항상 display:none (flex/grid 클래스가 덮어쓰는 것 방지) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 28px; }

a { color: inherit; }
::selection { background: var(--blue-ring); }

/* ----------------------------- 헤더 ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; background: none; border: none; cursor: pointer; padding: 0; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 8px; background: var(--black); color: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.brand-name { font-weight: 700; font-size: 16px; color: var(--text); white-space: nowrap; }
.brand-sub { font-size: 10px; color: var(--text-3); font-weight: 600; letter-spacing: 0.14em; }

.tabs { display: flex; gap: 2px; }
.tab {
  border: none; background: none; font: inherit; font-weight: 600; font-size: 14.5px;
  color: var(--text-3); padding: 8px 14px; border-radius: var(--radius-pill); cursor: pointer;
  white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: #fff; background: var(--black); }

.btn-write-top { white-space: nowrap; }

/* ----------------------------- 버튼 ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  padding: 11px 20px; border-radius: var(--radius-pill); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--blue-ring); }

.btn-primary { background: var(--black); color: #fff; }
.btn-primary:hover { background: var(--black-hover); }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text); }

.btn-danger { background: var(--surface); color: var(--danger); border-color: #f0c2c8; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 15px; font-size: 13px; }

/* ----------------------------- 뷰 전환 ----------------------------- */
.view { padding: 40px 0 90px; animation: fade-up 0.4s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ----------------------------- 히어로 ----------------------------- */
.hero { margin-bottom: 26px; }
.hero-title { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; letter-spacing: -0.035em; margin: 0 0 10px; color: var(--text); }
.hero-desc { color: var(--text-2); font-size: 16.5px; margin: 0; max-width: 640px; }

/* ----------------------------- 수업일·회차 필터 ----------------------------- */
.filter-wrap { border-bottom: 1px solid var(--border); margin-bottom: 26px; padding-bottom: 6px; }
.filter-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.filter-row + .filter-row { border-top: 1px dashed var(--border); }
.filter-label { flex-shrink: 0; width: 48px; font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: 0.02em; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: thin; flex: 1; }
.chips::-webkit-scrollbar { height: 5px; }
.chips::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font: inherit; font-weight: 600; font-size: 14px;
  padding: 8px 15px; border-radius: var(--radius-pill); cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.is-active { background: var(--black); color: #fff; border-color: var(--black); }
.chip-count {
  font-size: 12px; font-weight: 700; min-width: 16px; text-align: center;
  background: var(--bg-soft); color: var(--text-3); padding: 1px 7px; border-radius: var(--radius-pill);
}
.chip.is-active .chip-count { background: rgba(255,255,255,0.22); color: #fff; }

/* ----------------------------- 툴바 ----------------------------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.search-icon { position: absolute; left: 15px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; font: inherit; font-size: 14.5px; padding: 12px 40px 12px 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); }
.search-clear {
  position: absolute; right: 10px; width: 24px; height: 24px; border: none; border-radius: 50%;
  background: var(--bg-soft); color: var(--text-2); font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.search-clear:hover { background: var(--border-strong); }

.sort-group { display: flex; gap: 2px; background: var(--bg-soft); padding: 3px; border-radius: var(--radius-pill); }
.sort-btn {
  border: none; background: none; font: inherit; font-weight: 600; font-size: 13.5px;
  color: var(--text-2); padding: 8px 16px; border-radius: var(--radius-pill); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sort-btn:hover { color: var(--text); }
.sort-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ----------------------------- 분반 드롭다운(필터) ----------------------------- */
.section-select-wrap { position: relative; min-width: 240px; max-width: 360px; flex: 1; }
.section-select-wrap .select { padding: 9px 40px 9px 15px; font-weight: 600; font-size: 14px; border-radius: var(--radius-pill); background: var(--surface); }
.section-select-wrap .select-arrow { right: 15px; }

/* ----------------------------- 갤러리 그리드 ----------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }

/* 회차별 그룹 보기 */
.gallery-grouped { display: flex; flex-direction: column; gap: 36px; }
.group-head { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; padding-bottom: 11px; border-bottom: 2px solid var(--text); }
.group-head.is-none { color: var(--text-2); border-bottom-color: var(--border-strong); }
.group-count { font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--bg-soft); padding: 2px 9px; border-radius: var(--radius-pill); }

.work-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; cursor: pointer; transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s;
}
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.work-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; flex-wrap: wrap; }
.round-badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 700;
  color: var(--blue); background: var(--blue-soft); padding: 4px 10px; border-radius: var(--radius-pill);
  letter-spacing: -0.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.round-badge.is-none { color: var(--text-3); background: var(--bg-soft); }
.day-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  color: var(--text); background: var(--bg-soft); border: 1px solid var(--border-strong);
  padding: 3px 10px; border-radius: var(--radius-pill);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-badge svg { width: 12px; height: 12px; color: var(--text-3); flex-shrink: 0; }
.link-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 9px; border-radius: var(--radius-pill);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-chip svg { flex-shrink: 0; color: var(--text-3); }

.work-title {
  font-size: 17.5px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.work-excerpt {
  font-size: 14px; color: var(--text-2); margin: 0 0 18px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em;
}
.work-meta { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--border); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.work-meta-text { display: flex; flex-direction: column; line-height: 1.35; overflow: hidden; }
.work-author { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-date { font-size: 12px; color: var(--text-3); }
.work-stats { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.work-stat { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.work-stat svg, .like-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* 좋아요 버튼 (카드용) */
.like-btn {
  display: inline-flex; align-items: center; gap: 5px; border: none; background: none; padding: 0;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-3); cursor: pointer; transition: color 0.15s;
}
.like-btn svg { transition: transform 0.2s var(--ease); }
.like-btn:hover { color: var(--like); }
.like-btn.is-liked { color: var(--like); }
.like-btn.is-liked svg { fill: var(--like); stroke: var(--like); }
.like-btn.pop svg { animation: pop 0.32s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* 스켈레톤 */
.skeleton-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.sk { background: linear-gradient(90deg, #f0f0f2 25%, #e6e6e9 37%, #f0f0f2 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 5px; }
.sk-chip { height: 22px; width: 64px; border-radius: var(--radius-pill); margin-bottom: 14px; }
.sk-line { height: 13px; margin-bottom: 9px; }
.sk-line.w70 { width: 70%; } .sk-line.w40 { width: 40%; } .sk-line.w90 { width: 90%; }
.sk-meta { height: 28px; margin-top: 18px; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ----------------------------- 빈 상태 ----------------------------- */
.empty { text-align: center; padding: 80px 20px; }
.empty-art { color: var(--text-3); margin-bottom: 16px; display: flex; justify-content: center; }
.empty-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.empty-desc { color: var(--text-2); margin: 0 0 22px; }

/* ----------------------------- 페이지네이션 ----------------------------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 44px; flex-wrap: wrap; }
.page-btn {
  min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong);
  background: var(--surface); border-radius: var(--radius-sm); font: inherit; font-weight: 600; font-size: 14px;
  color: var(--text-2); cursor: pointer; transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--text); color: var(--text); }
.page-btn.is-active { background: var(--black); color: #fff; border-color: var(--black); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ----------------------------- 상세 ----------------------------- */
.back-btn { margin-bottom: 20px; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 38px; margin-bottom: 20px; }
.detail-badges { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.detail-head { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; flex-wrap: wrap; }
.detail-head .avatar { width: 44px; height: 44px; font-size: 17px; }
.detail-author-block { display: flex; flex-direction: column; }
.detail-author { font-size: 15px; font-weight: 700; }
.detail-date { font-size: 13px; color: var(--text-3); }
.detail-tools { margin-left: auto; display: flex; gap: 8px; }

.detail-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 22px; line-height: 1.28; }

.detail-link {
  display: inline-flex; align-items: center; gap: 9px; background: var(--black); color: #fff;
  font-weight: 600; font-size: 14.5px; padding: 13px 22px; border-radius: var(--radius-pill);
  text-decoration: none; margin-bottom: 26px; transition: background 0.15s, transform 0.08s; word-break: break-all;
}
.detail-link:hover { background: var(--black-hover); }
.detail-link:active { transform: translateY(1px); }

.detail-content { font-size: 16px; color: #222; line-height: 1.85; white-space: pre-wrap; word-break: break-word; margin-bottom: 30px; }
.detail-content a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }

.detail-foot { display: flex; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid var(--border); }
.like-pill {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); padding: 10px 20px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 14px; color: var(--text-2); cursor: pointer; transition: all 0.15s;
}
.like-pill svg { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.like-pill:hover { border-color: var(--like); color: var(--like); }
.like-pill.is-liked { background: var(--like-soft); border-color: var(--like); color: var(--like); }
.like-pill.is-liked svg { fill: var(--like); stroke: var(--like); }
.like-pill.pop svg { animation: pop 0.32s var(--ease); }
.detail-comment-count { color: var(--text-3); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.detail-comment-count svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ----------------------------- 댓글/의견 ----------------------------- */
.comments-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 38px 38px; }
.comments-title { font-size: 18px; font-weight: 700; margin: 0 0 20px; display: flex; align-items: center; gap: 9px; }
.count-badge { background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 700; padding: 2px 11px; border-radius: var(--radius-pill); }

.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-item { display: flex; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-item .avatar { width: 34px; height: 34px; font-size: 14px; }
.comment-main { flex: 1; min-width: 0; }
.comment-top { display: flex; align-items: baseline; gap: 9px; margin-bottom: 3px; }
.comment-author { font-weight: 700; font-size: 14px; }
.comment-date { font-size: 12px; color: var(--text-3); }
.comment-del { margin-left: auto; border: none; background: none; color: var(--text-3); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); }
.comment-del:hover { color: var(--danger); background: var(--danger-soft); }
.comment-text { font-size: 14.5px; color: #2a2a2e; white-space: pre-wrap; word-break: break-word; }
.comment-empty { text-align: center; color: var(--text-3); padding: 24px 0; font-size: 14px; }

.comment-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.comment-form-row { display: flex; gap: 10px; margin-bottom: 10px; }
.comment-form-row input { flex: 1; min-width: 0; }
.comment-form input, .comment-form textarea {
  font: inherit; font-size: 14px; width: 100%; padding: 11px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); }
.comment-form textarea { margin-bottom: 10px; min-height: 58px; }
.comment-form-actions { display: flex; justify-content: flex-end; }

/* ----------------------------- 관리자 ----------------------------- */
.admin-login { display: flex; justify-content: center; padding-top: 34px; }
.admin-login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 42px; width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-sm); }
.lock-mark { width: 54px; height: 54px; border-radius: var(--radius); background: var(--bg-soft); color: var(--text); display: grid; place-items: center; margin: 0 auto 18px; }
.admin-login-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.admin-login-desc { color: var(--text-2); font-size: 14px; margin: 0 0 24px; }
.admin-login-card input {
  font: inherit; width: 100%; text-align: center; letter-spacing: 0.4em; font-size: 20px; padding: 13px; margin-bottom: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2);
}
.admin-login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); background: var(--surface); }

.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 18px; text-align: center; }
.stat-num { display: block; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 600; }

.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px; }
.admin-section-title { font-size: 16px; font-weight: 700; margin: 0 0 5px; }
.admin-section-desc { font-size: 13.5px; color: var(--text-2); margin: 0 0 18px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.add-row-form { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.add-row-form input { font: inherit; font-size: 14px; flex: 1; min-width: 180px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.add-row-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); background: var(--surface); }

/* 수업일 · 회차 트리 */
.tree-admin { display: flex; flex-direction: column; gap: 12px; }
.tree-empty { color: var(--text-3); font-size: 14px; padding: 8px 0; }
.day-block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.day-block-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--surface-2); cursor: pointer; }
.day-block-chevron { color: var(--text-3); flex-shrink: 0; transition: transform 0.2s var(--ease); }
.day-block.collapsed .day-block-chevron { transform: rotate(-90deg); }
.day-block.collapsed .day-rounds { display: none; }
.day-block-title { font-weight: 700; font-size: 14.5px; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.day-block-title > svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.day-block-title .title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-block-count { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--bg-soft); padding: 2px 9px; border-radius: var(--radius-pill); }
.day-block-actions { display: flex; gap: 6px; flex-shrink: 0; }
.day-rounds { padding: 13px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.round-tag { display: inline-flex; align-items: center; gap: 7px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 600; padding: 6px 8px 6px 13px; border-radius: var(--radius-pill); }
.round-tag-count { opacity: 0.65; font-size: 12px; }
.round-tag-del { border: none; background: none; color: var(--blue); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; border-radius: 50%; opacity: 0.6; }
.round-tag-del:hover { opacity: 1; }
.round-add { display: inline-flex; align-items: center; gap: 6px; }
.round-add input { font: inherit; font-size: 13px; width: 150px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface); }
.round-add input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); }
.round-add-btn { border: 1px dashed var(--border-strong); background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: var(--radius-pill); cursor: pointer; transition: all 0.15s; }
.round-add-btn:hover { border-color: var(--text); color: var(--text); }

.icon-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: var(--radius-pill); cursor: pointer; transition: all 0.15s; }
.icon-btn:hover { border-color: var(--text); color: var(--text); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.round-edit-input { font: inherit; font-size: 14px; flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--blue); border-radius: var(--radius-sm); box-shadow: 0 0 0 4px var(--blue-ring); }

.change-pin-form { display: flex; gap: 10px; flex-wrap: wrap; }
.change-pin-form input { font: inherit; font-size: 14px; flex: 1; min-width: 150px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.change-pin-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); background: var(--surface); }

/* ----------------------------- 모달 ----------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(2px); animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-dialog { position: relative; background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modal-in 0.3s var(--ease); }
.modal-dialog.modal-sm { max-width: 400px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.modal-close { border: none; background: none; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: var(--radius-sm); display: grid; place-items: center; transition: background 0.15s, color 0.15s; }
.modal-close:hover { background: var(--bg-soft); color: var(--text); }
.modal-body { padding: 24px 26px 26px; }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.field-label em { color: var(--blue); font-style: normal; }
.field input, .field textarea {
  font: inherit; font-size: 15px; width: 100%; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); background: var(--surface); }
.field-hint { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

/* select */
.select-wrap { position: relative; }
.select {
  font: inherit; font-size: 15px; width: 100%; padding: 12px 40px 12px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  appearance: none; -webkit-appearance: none; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); background: var(--surface); }
.select-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.select:disabled { opacity: 0.55; cursor: not-allowed; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid .field { margin-bottom: 18px; }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.pw-modal-desc { font-size: 14px; color: var(--text-2); margin: 0 0 14px; }
#pw-input { font: inherit; font-size: 15px; width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
#pw-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); background: var(--surface); }

/* ----------------------------- 토스트 ----------------------------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--black); color: #fff; padding: 13px 22px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 200; opacity: 0; transition: opacity 0.25s, transform 0.25s var(--ease);
  pointer-events: none; max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: #0a7d3c; }

/* ----------------------------- 반응형 ----------------------------- */
@media (max-width: 720px) {
  .header-inner { height: 58px; gap: 12px; }
  .brand-sub { display: none; }
  .btn-write-top { padding: 9px 14px; }
  .btn-write-top span { display: none; }
  .container { padding: 0 18px; }
  .detail-card, .comments-card { padding: 26px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 20px 12px; }
  .stat-num { font-size: 27px; }
  .detail-tools { width: 100%; margin-left: 0; margin-top: 12px; }
}
@media (max-width: 480px) {
  .tabs .tab { padding: 7px 12px; font-size: 13.5px; }
  .gallery { grid-template-columns: 1fr; }
  .comment-form-row { flex-direction: column; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .filter-label { width: 40px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
