/* ============================================================
   숏 URL 단축 서비스 · 디자인 시스템
   다크 글래스모피즘 (참조 팔레트 실측) + 라이트 테마
   ============================================================ */

/* ---- 테마 토큰 ---- */
:root,
[data-theme="dark"] {
  --bg: #0f0f1a;
  --bg-2: #0b0b14;
  --card: rgba(30, 30, 50, 0.55);
  --card-solid: #1a1a2e;
  --field: rgba(255, 255, 255, 0.045);
  --field-focus: rgba(255, 255, 255, 0.07);
  --text: #f0f0f5;
  --muted: #9a9ab4;
  --faint: #8a8aa5;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
  --grid-line: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f5fb;
  --bg-2: #eceef7;
  --card: rgba(255, 255, 255, 0.75);
  --card-solid: #ffffff;
  --field: rgba(23, 23, 42, 0.035);
  --field-focus: rgba(23, 23, 42, 0.06);
  --text: #17172a;
  --muted: #5b5b74;
  --faint: #6e6e88;
  --border: rgba(23, 23, 42, 0.09);
  --border-strong: rgba(23, 23, 42, 0.16);
  --shadow: 0 24px 60px -24px rgba(40, 40, 90, 0.25);
  --grid-line: rgba(23, 23, 42, 0.06);
  color-scheme: light;
}

:root {
  --primary: #4b5ae4;
  --violet: #8b5cf6;
  --accent: #06b6d4;
  --grad: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #4b5ae4 100%);
  --grad-soft: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(75, 90, 228, 0.16));
  --danger: #ef4759;
  /* --danger는 color-mix/텍스트/테두리의 시드값이라 단색 유지.
     채워지는 면(버튼 배경 등)에는 아래 그라디언트를 사용한다. */
  --grad-danger: linear-gradient(135deg, #f9736a 0%, #ef4759 52%, #c2255c 100%);
  --grad-danger-soft: linear-gradient(135deg, rgba(249, 115, 106, 0.16), rgba(194, 37, 92, 0.16));
  --ok: #22c55e;
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Pretendard Variable", Pretendard, Inter, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans KR", sans-serif;
  --wrap: 1080px;
}

/* ---- 기본 ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

/* ---- 배경 격자 패턴 ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(90% 70% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(90% 70% at 50% 0%, #000 30%, transparent 78%);
  opacity: 0.6;
}

/* ---- 배경 오로라 ---- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48vw 42vw at 18% -8%, rgba(16, 185, 129, 0.28), transparent 60%),
    radial-gradient(42vw 38vw at 88% 4%, rgba(6, 182, 212, 0.22), transparent 62%),
    radial-gradient(46vw 40vw at 60% 108%, rgba(75, 90, 228, 0.24), transparent 60%);
  filter: saturate(1.1);
  animation: aurora 22s ease-in-out infinite alternate;
}
[data-theme="light"] .bg-aurora { opacity: 0.6; }
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -2%, 0) scale(1.08); }
}

/* ---- 헤더 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; }
.brand-mark {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(75, 90, 228, 0.7);
}
/* 마크는 brand_mark() 가 내보내는 인라인 SVG. stroke 는 currentColor 라 여기서 색이 정해진다 */
.brand-mark svg { display: block; width: 20px; height: 20px; }
/* 이름(쇼)과 설명(URL)을 굵기로 나눈다 — 같은 굵기면 한 덩어리로 뭉쳐 보인다 */
.brand-name { letter-spacing: -0.02em; white-space: nowrap; }
.brand-lead { font-weight: 900; }
.brand-tail { font-weight: 700; opacity: .72; margin-left: 1px; }
.site-nav { display: flex; align-items: center; gap: 10px; }
.nav-link { padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); background: var(--field); }
/* .nav-link / .adm-side-link 는 <a> 기준으로 만든 클래스다. <button> 에 그냥 붙이면
   브라우저 기본 회색(buttonface)과 기본 폰트·줄높이가 그대로 드러난다.
   실제로 대시보드 '공통 로딩화면' 버튼이 이래서 회색 덩어리로 보였다.
   버튼을 링크처럼 쓰는 자리가 계속 생기므로 여기서 한 번에 맞춘다. */
button.nav-link,
button.adm-side-link { background: transparent; font-family: inherit; line-height: inherit; cursor: pointer; }
.btn-solid { color: #fff !important; background: var(--grad); box-shadow: 0 8px 20px -8px rgba(75, 90, 228, 0.7); }
.btn-solid:hover { color: #fff !important; filter: brightness(1.06); }
.btn-ghost { border: 1px solid var(--border-strong); }
.logout-btn-block { display: block; width: 100%; text-align: left; border: 0; }

/* 테마 세그먼트 */
.theme-toggle {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--field); border: 1px solid var(--border); border-radius: 11px;
}
.theme-toggle button {
  width: 30px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-pressed="true"] { background: var(--card-solid); color: var(--text); box-shadow: 0 2px 8px -3px rgba(0,0,0,.4); }

/* ---- 메인 ---- */
.site-main { flex: 1; padding: 40px 0 72px; }

/* ---- 히어로 ---- */
.hero { text-align: center; padding: 30px 0 26px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.hero-eyebrow b { color: var(--text); font-weight: 700; }
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6.4vw, 60px);
  font-weight: 900; line-height: 1.05; letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 히어로 헤드라인 랜덤 슬라이드 로테이터 */
.hero-rotator { position: relative; overflow: hidden; min-height: 2.3em; }
.hero-rotator .hr-text {
  display: block;
  transform: translateY(0);
  opacity: 1;
  transition: transform .38s cubic-bezier(.4, 0, .2, 1), opacity .32s ease;
}
.hero-rotator .hr-text.hr-leave { transform: translateY(-20px); opacity: 0; }
.hero-rotator .hr-text.hr-enter-start { transition: none; transform: translateY(20px); opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .hero-rotator .hr-text { transition: none; }
}
.hero p.lead { margin: 18px auto 0; max-width: 520px; color: var(--muted); font-size: clamp(15px, 2.2vw, 18px); }

/* ---- 카드 ---- */
.card {
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- 단축 폼 ---- */
.shortener { max-width: 760px; margin: 30px auto 0; }
.shortener .card { padding: 8px; }
.tabs { display: flex; gap: 4px; padding: 6px; }
.tab {
  flex: 1; border: 0; cursor: pointer; padding: 12px; border-radius: var(--radius-sm);
  background: transparent; color: var(--faint); font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--muted); }
.tab[aria-selected="true"] { background: var(--field-focus); color: var(--text); }
.form-body { padding: 12px 18px 20px; }

/* ---- 단축 폼(미니멀 서치바) ---- */
.mini-shortener { max-width: 720px; margin: 30px auto 0; }
.mini-tabs {
  display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 4px;
  border-radius: 999px; background: var(--field); border: 1px solid var(--border);
}
.mini-tabs .tab { flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; font-size: 13.5px; }
.mini-bar.card {
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 22px;
  border-radius: 999px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: border-radius .15s;
}
.mini-bar.card:has(.mini-field[data-field="text"]:not([hidden])) {
  border-radius: var(--radius); padding: 16px 16px 16px 20px; align-items: flex-end;
}
.mini-bar.card:focus-within { box-shadow: 0 0 0 4px rgba(75, 90, 228, 0.28); }
.mini-field { flex: 1; min-width: 0; }
.mini-field[hidden] { display: none; }
.mini-input {
  display: block; width: 100%; border: 0; background: transparent; color: var(--text);
  font-size: 17px; padding: 12px 0; outline: none; font-family: inherit;
}
.mini-input::placeholder { color: var(--faint); }
.mini-textarea { resize: vertical; min-height: 44px; max-height: 200px; line-height: 1.5; }
.mini-bar .mini-go {
  width: auto; min-width: 48px; height: 48px; margin: 0; padding: 0 20px; border-radius: 999px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad); border: 0; color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(75, 90, 228, 0.7);
}
.mini-bar .mini-go svg { width: 20px; height: 20px; }
.mini-bar .mini-go:hover { filter: brightness(1.05); transform: none; }
.mini-bar .mini-go:disabled { opacity: .6; cursor: progress; }

.mini-more { margin-top: 14px; text-align: center; }
.mini-more summary {
  list-style: none; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px;
}
.mini-more summary::-webkit-details-marker { display: none; }
.mini-more summary:hover { color: var(--text); }
.mini-more summary svg { width: 14px; height: 14px; transition: transform .2s; }
.mini-more[open] summary svg { transform: rotate(180deg); }
.mini-opts {
  margin-top: 14px; padding: 20px 22px; border-radius: var(--radius-sm); background: var(--field);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; text-align: left;
}
.mini-opts .field { margin-top: 0; }
.mini-note { text-align: center; }
@media (max-width: 560px) {
  .mini-bar.card { padding: 5px 5px 5px 16px; }
  .mini-input { font-size: 15px; }
  /* 좁은 화면에서는 라벨을 숨기고 원형 아이콘 버튼으로 되돌린다 */
  .mini-bar .mini-go { width: 48px; padding: 0; border-radius: 50%; }
  .mini-bar .mini-go .mini-go-label { display: none; }
}
.field { margin-top: 16px; }
.field:first-child { margin-top: 6px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.input, .textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--field); border: 1px solid var(--border);
  color: var(--text); font-size: 15px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus {
  outline: none; border-color: color-mix(in srgb, var(--primary) 60%, transparent);
  background: var(--field-focus); box-shadow: 0 0 0 4px rgba(75, 90, 228, 0.14);
}
.code-field { display: flex; align-items: stretch; }
.code-prefix {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--field); border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.code-field .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* 비밀번호 토글 */
.switch-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; }
.switch { position: relative; flex: 0 0 auto; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--field);
  border: 1px solid var(--border); transition: background .18s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--faint); transition: transform .18s, background .18s;
}
.switch input:checked + .track { background: var(--grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(75, 90, 228, 0.22); }
.switch-label b { display: block; font-size: 14px; font-weight: 700; }
.switch-label span { font-size: 12.5px; color: var(--muted); }

.pw-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pw-fields[hidden] { display: none; }

/* 만료 라디오 세그먼트 */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.form-seg { grid-template-columns: 1fr 1fr; }
.form-seg label { font-size: 12.5px; }
.seg label {
  position: relative; text-align: center; padding: 11px 4px; border-radius: var(--radius-sm);
  background: var(--field); border: 1px solid var(--border); cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all .15s;
}
.seg label:hover { color: var(--text); border-color: var(--border-strong); }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { color: var(--text); }
.seg label:has(input:checked) {
  background: var(--grad-soft); border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  color: var(--text);
}
.seg label:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(75, 90, 228, 0.18); }

/* 제출 버튼 */
.btn-submit {
  width: 100%; margin-top: 22px; padding: 15px; border: 0; border-radius: var(--radius-sm);
  background: var(--grad); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(75, 90, 228, 0.8); transition: transform .12s, filter .15s, box-shadow .15s;
}
.btn-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: .6; cursor: progress; }

.form-note { margin: 16px 4px 0; font-size: 12.5px; color: var(--faint); line-height: 1.55; }
.form-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.form-error {
  margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: color-mix(in srgb, var(--danger) 88%, var(--text)); font-size: 14px;
}
.form-error[hidden] { display: none; }
.form-ok {
  margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
  color: color-mix(in srgb, var(--ok) 88%, var(--text)); font-size: 14px;
}
.form-ok[hidden] { display: none; }

/* ---- 헤더 계정 아이콘 ---- */
.acct-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; flex: 0 0 auto;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.acct-btn svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.acct-btn:hover { color: var(--text); background: var(--field); }

/* ---- 계정 모달 ---- */
.acct-modal { max-width: 460px; }
.acct-modal .edit-body { max-height: min(76vh, 720px); overflow-y: auto; }

/* 신원 요약 — 읽기 전용 값이라 입력창과 구분되게 표면만, 라벨/값 한 줄 */
.account-facts { margin: 0; border-radius: var(--radius-sm); background: var(--field); overflow: hidden; }
.account-facts > div {
  display: flex; align-items: baseline; gap: 14px;
  padding: 11px 14px; border-top: 1px solid var(--border);
}
.account-facts > div:first-child { border-top: 0; }
.account-facts dt { flex: 0 0 62px; font-size: 12.5px; font-weight: 700; color: var(--faint); }
.account-facts dd {
  margin: 0; flex: 1 1 auto; min-width: 0; text-align: right;
  font-size: 14px; font-weight: 700; color: var(--text); overflow-wrap: anywhere;
}

.account-sep { border: 0; border-top: 1px solid var(--border); margin: 20px 0 18px; }

.account-pw h4 { margin: 0; font-size: 14.5px; font-weight: 800; }
.account-pw .form-hint { margin-top: 5px; }
.account-pw-form { margin-top: 14px; }
.account-pw-form .field { margin-top: 12px; }
.account-pw-form .field:first-of-type { margin-top: 0; }
.account-pw-form .btn-pw {
  width: 100%; margin-top: 18px; padding: 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(75, 90, 228, 0.8);
  transition: transform .12s, filter .15s;
}
.account-pw-form .btn-pw:hover { filter: brightness(1.06); transform: translateY(-1px); }
.account-pw-form .btn-pw:active { transform: translateY(0); }

/* 탈퇴 — 파괴적이라 접힌 채로, 위쪽 경계로 확실히 분리 */
.acct-danger { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.acct-danger summary {
  cursor: pointer; font-size: 13.5px; font-weight: 700;
  color: color-mix(in srgb, var(--danger) 85%, var(--text));
}
.acct-danger .danger-zone-desc { margin: 12px 0; }
.acct-danger .danger-zone-form .input { flex: 1 1 160px; }

@media (prefers-reduced-motion: reduce) {
  .account-pw-form .btn-pw { transition: none; }
  .account-pw-form .btn-pw:hover { transform: none; }
}

/* ---- 결과 패널 ---- */
.result { margin-top: 18px; }
.result[hidden] { display: none; }
.result .card { padding: 22px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.result-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 24%, transparent); }
.result-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.result-body { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.result-main { flex: 1; min-width: 240px; }
.result-url {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--field); border: 1px solid var(--border);
}
.result-url a { flex: 1; font-weight: 700; font-size: 16px; color: var(--text); word-break: break-all; }
.copy-btn {
  flex: 0 0 auto; border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  padding: 8px 13px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.copy-btn:hover { background: var(--field-focus); }
.copy-btn.copied { background: var(--grad); color: #fff; border-color: transparent; }
.result-meta { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.qr-box { flex: 0 0 auto; padding: 10px; background: #fff; border-radius: 12px; line-height: 0; }
.qr-box canvas, .qr-box img { display: block; width: 128px; height: 128px; }

/* ---- 통계 ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 760px; margin: 34px auto 0; }
.stat { text-align: center; padding: 20px 12px; }
.stat .num {
  font-size: clamp(24px, 5vw, 32px); font-weight: 900; letter-spacing: -0.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .label { margin-top: 5px; font-size: 13px; color: var(--muted); }

/* ---- 기능 소개 ---- */
.features { max-width: 980px; margin: 72px auto 0; }
.features-head { text-align: center; max-width: 560px; margin: 0 auto 34px; }
.features-head .hero-eyebrow { margin-bottom: 14px; }
.features-head h2 { margin: 0 0 10px; font-size: clamp(24px, 3.6vw, 32px); font-weight: 900; letter-spacing: -0.03em; line-height: 1.25; }
.features-head .lead { margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card { padding: 24px 22px; }
.feature-ic {
  display: inline-grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px;
  border-radius: 13px; font-size: 22px;
  background: var(--grad-soft); border: 1px solid var(--border);
}
.feature-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.feature-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .features { margin-top: 52px; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ---- 좁은 컨텐츠(인증/게이트/정적) ---- */
.narrow { max-width: 460px; margin: 20px auto 0; }
.page-head { text-align: center; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(24px, 4.5vw, 32px); font-weight: 800; letter-spacing: -0.03em; }
.page-head p { margin: 0; color: var(--muted); }
.stack { display: flex; flex-direction: column; }
.stack .field { margin-top: 16px; }
.stack .btn-submit { margin-top: 22px; }
.form-hint { font-size: 12px; color: var(--faint); margin-top: 6px; }
.alt-link { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.alt-link a { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.back-home { display: block; text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }

/* 인증/게이트 카드 패딩 */
.auth-card { padding: 30px 28px; }

/* ---- 대시보드 ---- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); font-weight: 800; letter-spacing: -0.03em; }
.dash-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.dash-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 여기서는 테두리 있는 버튼과 없는 버튼이 나란히 선다. 투명 테두리로 높이를 맞춘다
   (헤더처럼 다른 곳까지 건드리지 않도록 이 영역에만 적용) */
.dash-head-actions .nav-link:not(.btn-ghost) { border: 1px solid transparent; }

/* 공통 로딩화면 적용 중 배너 — 목록 맨 위에서 적용 범위를 알린다 */
.sd-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px;
  background-image: var(--grad-soft);
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}
.sd-banner-img { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--field); }
.sd-banner-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sd-banner-body b { font-size: 14px; font-weight: 800; }
.sd-banner-body span { font-size: 12.5px; color: var(--muted); }
.sd-banner-acts { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) {
  .sd-banner { flex-wrap: wrap; }
  .sd-banner-acts { width: 100%; justify-content: flex-end; }
}
.dash-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 22px; align-items: start; }
.danger-zone {
  margin-top: 28px; padding: 18px 22px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border));
  background-image: var(--grad-danger-soft);
}
.danger-zone summary {
  cursor: pointer; font-size: 14px; font-weight: 700;
  color: color-mix(in srgb, var(--danger) 85%, var(--text));
}
.danger-zone-desc { margin: 12px 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.danger-zone-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.danger-zone-form .input { flex: 0 1 260px; height: 40px; }
.dash-create { padding: 22px; position: sticky; top: 88px; }
.dash-create h2 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.dash-create .muted { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

.link-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.link-item { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 0; }
.li-row1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.li-row1 .li-code { flex: 0 0 auto; }
.li-date { flex: 0 0 auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.li-row2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li-code { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; }
.li-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--field); color: var(--muted); border: 1px solid var(--border); }
.li-badge.perm { background: var(--grad-soft); color: var(--text); }
.li-target { margin-top: 5px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-meta { margin-top: 6px; font-size: 12px; color: var(--faint); display: flex; gap: 12px; flex-wrap: wrap; }
.li-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.icon-btn:hover { background: var(--field-focus); }
.icon-btn.danger:hover { background: var(--grad-danger); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -10px rgba(239, 71, 89, .8); }
.li-clicks { flex: 0 0 auto; padding: 6px 11px; border-radius: 8px; background: var(--field); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.li-clicks b { font-weight: 800; color: var(--text); font-size: 13px; margin-right: 2px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; }

/* ---- 게이트 / 텍스트 / 만료 / 404 ---- */
.center-card { padding: 34px 30px; text-align: center; }
.center-card .icon { font-size: 40px; margin-bottom: 12px; }
.center-card h1 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.center-card p { margin: 0 0 6px; color: var(--muted); }
.text-share { max-width: 680px; margin: 20px auto 0; }
.text-share .card { padding: 24px; }
.text-content { white-space: pre-wrap; word-break: break-word; font-size: 15.5px; line-height: 1.7; }
.text-actions { margin-top: 18px; display: flex; justify-content: flex-end; }

/* ---- 정적 문서 ---- */
.doc { max-width: 760px; margin: 10px auto 0; }
.doc .page-head { text-align: left; }
.doc-card { padding: 30px 32px; }
.doc-card h2 { font-size: 18px; font-weight: 800; margin: 26px 0 10px; letter-spacing: -.02em; }
/* 본문 흐름에서 한 단 낮춰 읽히는 부가 설명 (시간대·한도 같은 단서) */
.doc-note {
  margin: 10px 0 0; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--field); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted); line-height: 1.6;
}
.doc-note b { color: var(--text); }
/* ── 페이지 넘김 ── */
/* 관리자 화면과 회원 대시보드가 같은 헬퍼(admin_pagination)를 쓰므로 기본 모양은 여기 둔다.
   예전에는 admin.css 에만 있어서 대시보드에서는 스타일 없는 링크 줄로 보였다. */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pg-item {
  min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--field);
  font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none;
  font-variant-numeric: tabular-nums; transition: color .14s, border-color .14s, background .14s;
}
.pg-item:hover { color: var(--text); border-color: var(--border-strong); }
.pg-item.active { background: var(--grad); color: #fff; border-color: transparent; }
.pg-item.disabled { opacity: .4; pointer-events: none; }
.doc-card h2:first-child { margin-top: 0; }
.doc-card p, .doc-card li { color: var(--muted); font-size: 15px; }
.doc-card p { margin: 0 0 12px; }
.doc-card ul, .doc-card ol { margin: 0 0 14px; padding-left: 20px; }
.doc-card li { margin: 6px 0; }
.doc-card code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px;
  background: var(--field); padding: 2px 6px; border-radius: 6px; color: var(--text);
}
.doc-card pre {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; overflow-x: auto; margin: 0 0 16px;
}
.doc-card pre code { background: none; padding: 0; font-size: 13px; line-height: 1.6; color: var(--text); }

/* 아코디언(FAQ) */
.accordion details {
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px;
  background: var(--field); overflow: hidden;
}
.accordion summary {
  cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: 15px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.accordion summary::-webkit-details-marker { display: none; }
/* 펼침 표시는 아이콘 폰트의 글리프를 직접 찍는다(::after 에는 태그를 못 넣는다).
   코드포인트는 bootstrap-icons 1.11.3 의 bi-plus-lg / bi-dash-lg 다 —
   버전을 올리면 이 값이 바뀔 수 있으니 layout.php 의 버전과 함께 확인할 것. */
.accordion summary::after { font-family: "bootstrap-icons"; content: "\f64d"; color: var(--muted); transition: transform .2s; }
.accordion details[open] summary::after { content: "\f63b"; }
.accordion .acc-body { padding: 0 18px 16px; color: var(--muted); font-size: 14.5px; }

/* ---- 푸터 ---- */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.footer-links a { font-size: 13.5px; color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--text); }
.copyright { margin: 0; font-size: 13px; color: var(--faint); }

/* ---- 이동 인터스티셜 ---- */
.interstitial-body { justify-content: center; }
.interstitial {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 40px 20px; width: 100%;
}
.inter-card {
  width: 100%; max-width: 440px; padding: 34px 30px 28px; text-align: center;
  animation: rise .35s ease;
}
.spinner {
  width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, var(--primary) 55%, var(--accent) 85%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.inter-card h1 { margin: 0 0 6px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.inter-sub { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.inter-dest {
  margin: 0 auto 20px; max-width: 100%; padding: 9px 14px; border-radius: 999px;
  background: var(--field); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ad-slot {
  display: grid; place-items: center; margin: 0 0 18px;
  border-radius: var(--radius-sm); overflow: hidden;
}
.ad-slot img { display: block; max-width: 100%; max-height: 180px; border-radius: var(--radius-sm); object-fit: contain; }
.inter-progress { height: 4px; border-radius: 999px; background: var(--field); overflow: hidden; margin-bottom: 18px; }
.inter-progress span { display: block; height: 100%; width: 0; background: var(--grad); animation: progress 2s linear forwards; }
@keyframes progress { to { width: 100%; } }
.manual-go { font-size: 13.5px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; transition: color .15s; }
.manual-go:hover { color: var(--text); }

/* PRO 커스텀 스플래시 로딩화면 */
.inter-card--splash { padding: 26px 24px 24px; }
.splash-media { margin: 0 0 18px; }
.splash-media img {
  display: block; max-width: 100%; max-height: 320px; margin: 0 auto;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  object-fit: contain;
}
.splash-text {
  margin: 0 0 20px; font-size: 16px; font-weight: 700; line-height: 1.5;
  color: var(--text); letter-spacing: -.01em;
}

/* 꾸미기 모달 — 이미지 드롭존(QR 스튜디오와 동일 패턴) */
.sp-drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 118px; padding: 16px; margin: 4px 0 12px;
  border: 2px dashed var(--border-strong); border-radius: 12px;
  background: var(--field); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.sp-drop:hover, .sp-drop.over { border-color: var(--primary); background: var(--field-focus); }
.sp-drop input { display: none; }
.sp-drop-text { font-size: 13px; color: var(--muted); line-height: 1.5; }
.sp-drop-img { max-width: 100%; max-height: 200px; border-radius: 8px; object-fit: contain; }
.sp-drop-x {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px; display: grid; place-items: center;
  padding: 0; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; line-height: 1;
  backdrop-filter: blur(2px); transition: background .15s, transform .12s;
}
.sp-drop-x:hover { background: var(--grad-danger); transform: scale(1.08); }
/* 머무는 시간 — 기본값을 라벨에 드러내 아무것도 안 골랐을 때를 알 수 있게 */
.dwell-seg { margin-top: 8px; }
.dwell-def { font-size: 10px; font-weight: 800; opacity: .6; margin-left: 3px; }
.sp-drop-x[hidden] { display: none; }
.sp-skip-note {
  margin: 12px 0 0; padding: 11px 13px; border-radius: 10px;
  background: var(--field); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
}

/* ---- 관리자 2단계 인증 ---- */
/* 이 화면은 bare 레이아웃(헤더 없음)이라 위쪽 여백을 여기서 만든다 */
.otp-wrap { margin-top: 6vh; }
.otp-badge {
  width: 62px; height: 62px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 38%, transparent);
  color: var(--brand);
}
.otp-badge svg { width: 30px; height: 30px; }
.otp-head { margin-bottom: 18px; }
.otp-card { gap: 4px; }

/* 6칸 입력 — JS 가 켜져야 보인다(기본 hidden) */
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 16px; }
.otp-boxes[hidden] { display: none; }
.otp-box {
  width: 100%; height: 58px; padding: 0; text-align: center;
  font-size: 26px; font-weight: 800; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--field);
  border: 1px solid var(--border-strong); border-radius: 12px;
  transition: border-color .12s, box-shadow .12s;
}
.otp-box:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.otp-plain { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: .35em; }
.otp-fallback[hidden] { display: none; }

.otp-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 14px 0 4px; flex-wrap: wrap;
}
.otp-paste {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--text);
  background: var(--field); border: 1px solid var(--border-strong);
  transition: background .12s, border-color .12s;
}
.otp-paste:hover { background: var(--surface-2); border-color: var(--brand); }
.otp-paste svg { width: 15px; height: 15px; }
.otp-timer { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.otp-foot {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 18px; flex-wrap: wrap;
}
.otp-resend, .otp-cancel {
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid var(--border);
  transition: color .12s, border-color .12s, background .12s;
}
.otp-resend:hover { color: var(--text); border-color: var(--brand); background: var(--field); }
.otp-cancel:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--field); }

@media (max-width: 420px) {
  .otp-boxes { gap: 5px; }
  .otp-box { height: 50px; font-size: 21px; border-radius: 10px; }
}
