/* ================================================================
   Yeon's Clipboard — Legal Pages Stylesheet
   ================================================================ */

:root {
    --bg-app: #f6f7f9;
    --bg-surface: #ffffff;
    --bg-surface-2: #f2f4f7;
    --text-primary: #1a1d22;
    --text-secondary: #5b6472;
    --text-muted: #7a8393;
    --border-color: #e4e7ec;
    --primary: #0b63d0;
    --primary-hover: #0a54b0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-app: #0f1115;
        --bg-surface: #181b20;
        --bg-surface-2: #22262d;
        --text-primary: #eef1f5;
        --text-secondary: #b0b6bf;
        --text-muted: #8a9199;
        --border-color: #2a2f37;
        --primary: #4c8bf5;
        --primary-hover: #6ea2ff;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding: calc(20px + var(--safe-top)) 24px calc(32px + var(--safe-bottom));
}

/* 헤더 */
.legal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.legal-home {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.legal-home:hover {
    background: var(--bg-surface-2);
}

.legal-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.legal-nav a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}
.legal-nav a:hover {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}
.legal-nav a.active {
    background: var(--bg-surface-2);
    color: var(--text-primary);
    font-weight: 600;
}

/* 본문 */
.legal-main {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
}

.legal-main h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.legal-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.legal-section {
    margin-bottom: 24px;
}
.legal-section:last-child {
    margin-bottom: 0;
}
.legal-section h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.legal-section p {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.legal-section p:last-child {
    margin-bottom: 0;
}
.legal-section ul {
    padding-left: 22px;
    margin-bottom: 10px;
}
.legal-section li {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.legal-section strong {
    color: var(--text-primary);
    font-weight: 600;
}
.legal-section a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}
.legal-section a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 푸터 */
.legal-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.legal-footer p {
    margin-bottom: 8px;
}
.legal-footer p:last-child {
    margin-bottom: 0;
}
.legal-footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.legal-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}
.legal-footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
.legal-footer-links span {
    color: var(--text-muted);
}

/* 모바일 */
@media (max-width: 600px) {
    .legal-page {
        padding: calc(16px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
    }
    .legal-header {
        padding-bottom: 16px;
        margin-bottom: 20px;
    }
    .legal-main {
        padding: 22px 18px;
        border-radius: var(--radius-md);
    }
    .legal-main h1 {
        font-size: 22px;
    }
    .legal-section h2 {
        font-size: 16px;
    }
    .legal-section p,
    .legal-section li {
        font-size: 14px;
    }
}
