/* ==========================================================================
   ZZAN 포털 (zzan_portal) — 독립형 앱 셸 디자인 시스템
   짠짠미(zzan.css) 톤 차용 · 라이트/다크 · 앱스토어식 카드 그리드
   ========================================================================== */

:root {
    --accent: #ef4e2b;
    /* weak/strong 은 --accent 파생 → 관리자 point_color 로 --accent 만 덮어써도 전부 따라감 */
    --accent-weak: color-mix(in srgb, var(--accent) 12%, transparent);
    --accent-strong: color-mix(in srgb, var(--accent) 86%, #000);
    --gold: #d99a2b;

    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f6f8;
    --text: #0f1318;
    --muted: #66717d;
    --border: #e7e9ec;
    --border-strong: #d7dbe0;

    --header-h: 64px;
    --maxw: 1120px;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 6px 24px color-mix(in srgb, var(--accent) 14%, transparent);
    --font: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont,
        "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
    --accent: #ff5d3b;
    --accent-weak: color-mix(in srgb, var(--accent) 18%, transparent);
    --accent-strong: color-mix(in srgb, var(--accent) 80%, #fff);
    --gold: #e6b24d;

    --bg: #0a0c10;
    --surface: #0f1217;
    --surface-2: #171b22;
    --text: #e7ebf0;
    --muted: #8b95a2;
    --border: #1e242c;
    --border-strong: #2a313b;
    --shadow: 0 8px 28px color-mix(in srgb, var(--accent) 26%, transparent);
}

/* 페이지 전역 리셋 */
html, body { margin: 0 !important; padding: 0 !important; background: var(--bg); }
body { overflow-x: hidden; }

#zzan_portal, #zzan_portal * { box-sizing: border-box; }
#zzan_portal {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
#zzan_portal a { color: inherit; text-decoration: none; }
.zp-ico { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.zp-ico--sun { display: none; }
[data-theme="dark"] .zp-ico--sun { display: block; }
[data-theme="dark"] .zp-ico--moon { display: none; }

/* ───────── Header ───────── */
.zp-header {
    position: sticky; top: 54px; z-index: 30; /* ZZAN Top Bar(54px) 아래에 스택 */
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(150%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.zp-header__inner {
    max-width: var(--maxw); height: 100%; margin: 0 auto;
    padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
}
.zp-logo { display: inline-flex; align-items: center; gap: 10px; }
.zp-logo__mark { width: 26px; height: 26px; color: var(--accent); }
.zp-logo__img { height: 30px; width: auto; display: block; }
.zp-logo__text { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.zp-header__actions { display: flex; align-items: center; gap: 10px; }

.zp-iconbtn {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); color: var(--text);
    cursor: pointer; transition: background .15s, border-color .15s;
}
.zp-iconbtn:hover { background: var(--surface-2); border-color: var(--border-strong); }

.zp-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px;
    border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
    border: 1px solid transparent; transition: all .15s; font-family: inherit;
}
.zp-btn--solid { background: var(--accent); color: #fff; }
.zp-btn--solid:hover { background: var(--accent-strong); }
.zp-btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.zp-btn--ghost:hover { background: var(--surface-2); }

/* ───────── Main ───────── */
.zp-main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px 64px; }

/* ───────── Banner ───────── */
.zp-banner {
    margin: 28px 0 8px; padding: 56px 40px; border-radius: 24px;
    background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%), var(--surface-2);
    border: 1px solid var(--border);
    background-size: cover; background-position: center;
}
.zp-banner--image { border: none; color: #fff; }
.zp-banner__inner { max-width: 720px; }
.zp-banner__title { margin: 0; font-size: clamp(28px, 5vw, 46px); font-weight: 900; letter-spacing: -.03em; }
.zp-banner__subtitle { margin: 12px 0 0; font-size: clamp(15px, 2.2vw, 18px); color: var(--muted); }
.zp-banner--image .zp-banner__subtitle { color: rgba(255,255,255,.86); }
.zp-banner__cta {
    margin-top: 24px; display: inline-flex; align-items: center; gap: 8px;
    height: 48px; padding: 0 24px; border-radius: 14px;
    background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
    transition: background .15s, transform .15s;
}
.zp-banner__cta:hover { background: var(--accent-strong); transform: translateY(-1px); }

/* ───────── Section ───────── */
.zp-section { margin-top: 44px; }
.zp-section__head { margin-bottom: 18px; }
.zp-section__title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.zp-section__subtitle { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ───────── Card grid (app store style) ───────── */
.zp-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.zp-card {
    position: relative; display: flex; align-items: center; gap: 16px;
    padding: 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform .16s ease, border-color .16s, box-shadow .16s;
}
a.zp-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--accent-weak);
}
.zp-card--soon { opacity: .72; cursor: default; }

.zp-card__icon {
    width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border);
}
.zp-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.zp-card__icon-fallback { font-size: 24px; font-weight: 800; color: var(--accent); }

.zp-card__body { flex: 1; min-width: 0; }
.zp-card__titlerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zp-card__title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.zp-card__subtitle {
    margin: 4px 0 0; font-size: 13px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zp-card__go { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: all .16s; }
a.zp-card:hover .zp-card__go { color: var(--accent); opacity: 1; transform: translateX(0); }

/* ───────── Badge ───────── */
.zp-badge {
    font-style: normal; font-size: 11px; font-weight: 800; line-height: 1;
    padding: 4px 8px; border-radius: 999px;
    background: var(--accent); color: #fff; letter-spacing: .01em;
}
.zp-badge--soon { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-strong); }

/* ───────── Empty / Footer ───────── */
.zp-empty { margin-top: 60px; text-align: center; color: var(--muted); }

.zp-footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px; text-align: center; color: var(--muted);
}
.zp-footer__brand { margin: 0 0 4px; font-weight: 800; color: var(--text); }
.zp-footer__copy { margin: 0; font-size: 13px; }

/* footer 다크모드 토글 */
.zp-theme-toggle {
    display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 18px;
    height: 38px; padding: 0 16px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.zp-theme-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); }
.zp-theme-toggle .zp-ico { width: 17px; height: 17px; }
.zp-theme-toggle__label { line-height: 1; }

/* ───────── Responsive ───────── */
@media (max-width: 640px) {
    .zp-header__inner, .zp-main { padding-left: 16px; padding-right: 16px; }
    .zp-banner { padding: 40px 24px; border-radius: 18px; }
    .zp-grid { grid-template-columns: 1fr; }
}
