* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #0891B2;
  --primary-dark: #155E75;
  --primary-light: #CFFAFE;
  --secondary: #0C419A;
  --secondary-light: #DBEAFE;
  --bg: #F5F5F5;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --success: #16A34A;
  --warning: #F59E0B;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: #E8E8E8;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  padding-bottom: 72px;
  box-shadow: 0 0 20px rgba(0,0,0,0.08);
}

a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  font-weight: 900;
  font-size: 22px;
  color: var(--primary);
  letter-spacing: -1.5px;
}
.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--success);
  font-weight: 700;
  background: #DCFCE7;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.header-back {
  background: none; border: none;
  font-size: 22px; color: var(--text);
  cursor: pointer; padding: 0; width: 32px;
}

.header-title {
  font-size: 16px; font-weight: 700;
}

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  padding: 6px 0 8px;
  z-index: 100;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 0;
  font-weight: 600;
}
.bottom-nav a.active { color: var(--primary); }
.nav-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.nav-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===== Hero slider ===== */
.hero {
  margin: 14px 16px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #0891B2 0%, #0E7490 100%);
  color: white;
  padding: 22px 20px;
  position: relative;
  box-shadow: 0 4px 16px rgba(8,145,178,0.25);
}
.hero::after {
  content: ""; position: absolute;
  right: -40px; bottom: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.hero-title { font-size: 22px; font-weight: 800; line-height: 1.3; position: relative; z-index: 1; }
.hero-sub { font-size: 13px; opacity: 0.95; margin-top: 6px; position: relative; z-index: 1; }
.hero-dots { display: flex; gap: 4px; margin-top: 14px; position: relative; z-index: 1; }
.hero-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
.hero-dots span.active { background: white; width: 18px; border-radius: 3px; }

/* ===== Quick menu ===== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px 16px 16px;
}
.quick-item {
  background: white;
  border-radius: 12px;
  padding: 14px 4px 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.quick-circle {
  width: 36px; height: 36px;
  border-radius: 10px;
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.quick-red { background: var(--primary-light); color: var(--primary); }
.quick-blue { background: var(--secondary-light); color: var(--secondary); }
.quick-orange { background: #FED7AA; color: #C2410C; }
.quick-green { background: #BBF7D0; color: #15803D; }
.quick-label { font-size: 12px; font-weight: 600; }

/* ===== Sections ===== */
.section { margin-top: 8px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
}
.section-title { font-size: 15px; font-weight: 700; }
.section-more { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ===== Sale card (떨이) ===== */
.sale-list { padding: 0 16px; }
.sale-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: white;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.sale-img {
  width: 64px; height: 64px;
  border-radius: 8px;
  background: #FAFAFA;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-light); font-weight: 600;
  border: 1px dashed var(--border);
}
.sale-info { flex: 1; min-width: 0; }
.sale-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.sale-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.sale-price { font-weight: 800; color: var(--primary); font-size: 14px; }
.sale-strike { color: var(--text-light); text-decoration: line-through; font-size: 12px; font-weight: 500; margin-right: 6px; }
.sale-stock {
  font-size: 11px;
  color: var(--warning);
  font-weight: 700;
  background: #FEF3C7;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== Group buy ===== */
.gb-card {
  margin: 0 16px 8px;
  background: white;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border);
}
.gb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gb-title { font-weight: 700; font-size: 14px; }
.gb-deadline { font-size: 11px; color: var(--primary); font-weight: 700; background: var(--primary-light); padding: 2px 8px; border-radius: 4px; }
.gb-progress { background: #F3F4F6; height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.gb-progress-fill { height: 100%; background: var(--primary); }
.gb-stats { font-size: 11px; color: var(--text-muted); }

/* ===== Board recent ===== */
.board-list { background: white; border-radius: 12px; margin: 0 16px 8px; overflow: hidden; border: 1px solid var(--border); }
.board-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.board-row:last-child { border-bottom: none; }
.board-row-title { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.board-row-meta { font-size: 11px; color: var(--text-light); flex-shrink: 0; }
.board-row .new-tag { color: var(--primary); font-weight: 700; font-size: 11px; margin-left: 4px; }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 53px;
  z-index: 90;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ===== Event card (할인) ===== */
.event-list { padding: 12px 16px; }
.event-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: white;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.event-img {
  width: 88px; height: 88px;
  border-radius: 10px;
  background: linear-gradient(135deg, #CFFAFE, #A5F3FC);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--primary); font-weight: 700; text-align: center;
}
.event-info { flex: 1; min-width: 0; }
.event-tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}
.event-tag.tag-1plus1 { background: var(--primary); color: white; }
.event-tag.tag-2plus1 { background: var(--secondary); color: white; }
.event-tag.tag-discount { background: #F59E0B; color: white; }
.event-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; line-height: 1.3; }
.event-period { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.event-price { font-size: 16px; font-weight: 800; color: var(--primary); }
.event-price .strike { color: var(--text-light); text-decoration: line-through; font-size: 12px; font-weight: 500; margin-right: 6px; }

/* ===== Board page ===== */
.board-filter {
  display: flex; gap: 8px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }

.board-page-list { background: white; }
.post-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.post-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.post-cat.cat-free { background: #DBEAFE; color: var(--secondary); }
.post-cat.cat-req { background: #FED7AA; color: #C2410C; }
.post-cat.cat-lost { background: #E0E7FF; color: #4338CA; }
.post-cat.cat-job { background: #BBF7D0; color: #15803D; }
.post-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.post-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; }

.fab {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(176px);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(8,145,178,0.4);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 300;
  line-height: 1;
}
@media (max-width: 480px) {
  .fab { transform: none; left: auto; right: 16px; }
}

/* ===== Login ===== */
.login-page {
  padding: 80px 28px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: white;
}
.login-brand {
  text-align: center;
  margin-bottom: 56px;
}
.login-brand .brand-mark { font-size: 44px; letter-spacing: -2.5px; }
.login-brand .brand-sub { font-size: 14px; margin-top: 6px; display: block; }

.input-group { margin-bottom: 14px; }
.input-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; color: var(--text-muted); }
.input {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: white;
  font-family: inherit;
}
.input:focus { outline: none; border-color: var(--primary); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-row label { cursor: pointer; user-select: none; }

.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:active { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 12px; }

.divider {
  text-align: center; margin: 20px 0; color: var(--text-light); font-size: 13px;
  display: flex; align-items: center; gap: 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.signup-link {
  text-align: center; margin-top: auto; padding-top: 32px;
  font-size: 13px; color: var(--text-muted);
}
.signup-link a { color: var(--primary); font-weight: 700; margin-left: 4px; }

/* ===== Modal (홈화면 추가) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: white;
  border-radius: 20px;
  padding: 28px 24px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-icon-wrap {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  background: var(--primary-light);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
}
.modal-icon-wrap svg { width: 36px; height: 36px; stroke: var(--primary); fill: none; stroke-width: 2; }

.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.55; }
.modal-guide {
  background: #FAFAFA;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  margin-bottom: 18px;
  line-height: 1.6;
}
.modal-guide strong { color: var(--primary); }
.modal-buttons { display: flex; gap: 8px; }
.modal-buttons .btn { flex: 1; padding: 13px; font-size: 14px; }

/* ===== 관리자 배너 (blackmoon 로그인 시만 표시) ===== */
.admin-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1A1A1A;
  color: white;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  position: sticky;
  top: 53px;
  z-index: 95;
}
.admin-banner strong { color: #67E8F9; font-weight: 800; }
.admin-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(8,145,178,0.25);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(8,145,178,0.25); }
  50% { box-shadow: 0 0 0 8px rgba(8,145,178,0.05); }
}

/* ===== GS25 듀얼 컬러 브랜드 마크 ===== */
.brand-mark .bm-r { color: var(--primary); }
.brand-mark .bm-b { color: var(--secondary); }

/* 공지사항 섹션 — 네이비 액센트 */
.section-title.title-notice {
  display: inline-flex;
  align-items: center;
}
.section-title.title-notice::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--secondary);
  border-radius: 2px;
  margin-right: 8px;
}
.notice-pin {
  display: inline-block;
  background: var(--secondary);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  letter-spacing: -0.2px;
  vertical-align: 1px;
}

/* utilities */
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
