/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(160deg, #ddeeff 0%, #c8e0ff 100%);
    min-height: 100vh;
    color: #191f28;
    -webkit-font-smoothing: antialiased;
}

/* ── 로켓 배경 레이어 ──────────────────────────────────────── */
#rocket-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.rocket-particle {
    position: absolute;
    animation: rocket-fly linear infinite;
    will-change: transform, opacity;
    image-rendering: -webkit-optimize-contrast;
}

@keyframes rocket-fly {
    0%   { transform: translate(0, 0); opacity: 0; }
    15%  { opacity: var(--max-opacity); }
    85%  { opacity: var(--max-opacity); }
    100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

/* ── 랜딩 레이아웃 ─────────────────────────────────────────── */
.landing-wrap {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.landing-header {
    padding: 20px 20px 16px;
}

.logo {
    font-size: 18px;
    font-weight: 900;
    color: #1A56DB;
    letter-spacing: -0.5px;
}

/* ── DB 카드 ────────────────────────────────────────────────── */
.db-card {
    background: #fff;
    border-radius: 20px;
    margin: 0 16px;
    padding: 24px 20px 28px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    min-height: 200px;
}

/* ── 상태 (로딩 / 오류) ────────────────────────────────────── */
.state-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #8b95a1;
    font-size: 14px;
    text-align: center;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e8eb;
    border-top-color: #1A56DB;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 14px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── DB 제목 ────────────────────────────────────────────────── */
.db-title-row { margin-bottom: 16px; }

.db-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    margin: 0 0 6px;
    line-height: 1.3;
}

.author-badge {
    font-size: 13px;
    color: #8b95a1;
    font-weight: 500;
}

/* ── 메타 아코디언 ──────────────────────────────────────────── */
.meta-toggle {
    width: 100%;
    background: #f8f9fa;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #4e5968;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.12s;
    margin-bottom: 2px;
}

.meta-toggle:hover { background: #f0f2f5; }

.meta-grid {
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
    padding: 4px 16px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 4px;
}

.meta-item label {
    display: block;
    font-size: 11px;
    color: #adb5bd;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
}

.meta-item span {
    font-size: 13px;
    color: #4e5968;
    font-weight: 500;
    line-height: 1.4;
}

.meta-date-val { font-size: 12px !important; }

/* ── 구분선 ─────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: #f0f2f5;
    margin: 20px 0;
}

/* ── 내용 블록 ──────────────────────────────────────────────── */
.content-block { margin-bottom: 20px; }

.content-label {
    font-size: 11px;
    font-weight: 700;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0 0 8px;
}

.content-text {
    font-size: 14px;
    color: #191f28;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* ── 암호화 안내 ─────────────────────────────────────────────── */
.enc-notice {
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #795548;
    line-height: 1.6;
    margin-top: 12px;
}

/* ── CTA 섹션 ────────────────────────────────────────────────── */
.cta-section {
    padding: 16px 16px 0;
}

.cta-inner {
    background: #fff;
    border-radius: 20px;
    padding: 22px 20px 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* 상단 전체 너비 헤더 */
.cta-col-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
}

.cta-header-divider {
    height: 1px;
    background: #f0f2f5;
    margin: 18px 0;
}

/* 두 컬럼: 앱(좌) | 확장프로그램(우) — 아래 중복 .cta-col-header 제거됨 */
.cta-cols {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: stretch;
}

.cta-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.cta-divider {
    width: 1px;
    background: #f0f2f5;
    flex: 0 0 1px;
    margin: 0 20px;
    align-self: stretch;
}

/* 좁은 화면: 세로 스택 */
@media (max-width: 600px) {
    .cta-cols {
        flex-direction: column;
        gap: 20px;
    }

    .cta-divider {
        width: auto;
        height: 1px;
        flex: 0 0 1px;
        margin: 0;
        align-self: stretch;
    }
}

/* ── CTA 텍스트 ─────────────────────────────────────────────── */
.cta-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.cta-title {
    font-size: 20px;
    font-weight: 700;
    color: #191f28;
    margin: 0 0 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.cta-sub {
    font-size: 14px;
    color: #8b95a1;
    margin: 0;
    line-height: 1.5;
    white-space: nowrap;
}

.install-hint {
    font-size: 11px;
    color: #1A56DB;
    background: #EEF4FF;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
}

/* ── 확장프로그램 미리보기 ────────────────────────────────────── */
.ext-preview-wrap {
    position: relative;
    cursor: zoom-in;
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.ext-preview-wrap:hover .ext-expand-btn {
    opacity: 1;
    transform: scale(1);
}

.ext-preview {
    width: 100%;
    display: block;
    border-radius: 10px;
    object-fit: cover;
    object-position: right top;
    border: 1px solid #f0f2f5;
    transition: filter 0.2s;
}

.ext-preview-wrap:hover .ext-preview {
    filter: brightness(0.92);
}

.ext-expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 7px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4e5968;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.18s, transform 0.18s;
    pointer-events: none;
}

/* 터치 기기: 아이콘 항상 표시 */
@media (hover: none) {
    .ext-expand-btn {
        opacity: 1;
        transform: scale(1);
    }
    .ext-preview-wrap:hover .ext-preview {
        filter: none;
    }
}

/* ── 라이트박스 ──────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: zoom-out;
    animation: lb-in 0.2s ease;
}

.lightbox.open {
    display: flex;
}

@keyframes lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-img {
    max-width: min(900px, 100%);
    max-height: 90vh;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    animation: lb-img-in 0.22s ease;
}

@keyframes lb-img-in {
    from { transform: scale(0.93); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

/* ── 스토어 버튼 (세로 스택) ─────────────────────────────────── */
.store-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-store {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a2e;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    padding: 11px 14px;
    transition: background 0.15s;
}

.btn-store:active { background: #111; }

.store-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.store-text {
    display: flex;
    flex-direction: column;
}

.store-sub {
    font-size: 9px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    line-height: 1.2;
}

.store-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.cta-spacer { height: 8px; }

/* ── 인앱 브라우저 모달 ──────────────────────────────────────── */
.fullscreen-overlay {
    position: fixed;
    inset: 0;
    background: #f0f2f5;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.modal-icon { font-size: 36px; display: block; margin-bottom: 4px; }

.modal-title {
    margin: 12px 0 8px;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

.modal-desc {
    font-size: 14px;
    color: #8b95a1;
    line-height: 1.7;
    margin: 0 0 24px;
}

.btn-modal {
    width: 100%;
    padding: 14px 20px;
    background: #1A56DB;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ── 토스트 ─────────────────────────────────────────────────── */
#dash-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    transition: opacity 0.3s;
    white-space: nowrap;
    font-family: inherit;
}

/* ── 데스크탑 ────────────────────────────────────────────────── */
@media (min-width: 641px) {
    .db-card { padding: 32px 28px 36px; }
    .cta-inner { padding: 24px 24px 28px; }
}
