:root {
    --primary-color: #3182f6;
    --primary-hover: #1b64da;
    --primary-light: #e8f3ff;
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --text-primary: #191f28;
    --text-secondary: #4e5968;
    --text-tertiary: #8b95a1;
    --border-color: #e5e8eb;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --scrim-color: rgba(0, 0, 0, 0.4);
    --transition-base: 0.25s ease;
}

[data-theme="dark"] {
    --bg-primary: #111213;
    --bg-secondary: #16181a;
    --text-primary: #f5f6f7;
    --text-secondary: #c1c7cd;
    --text-tertiary: #8a9199;
    --border-color: #2a2f35;
    --card-bg: #1b1d1f;
    --card-shadow: rgba(0, 0, 0, 0.35);
    --scrim-color: rgba(0, 0, 0, 0.6);
}

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

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-base), color var(--transition-base);
}

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

a:hover {
    color: var(--primary-color);
}

.page-offset {
    padding-top: 96px;
}

.app-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
}

[data-theme="dark"] .app-header {
    background: rgba(17, 17, 17, 0.78);
}

.brand {
    font-weight: 900;
    letter-spacing: -0.3px;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn,
.lang-btn {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    box-shadow: 0 2px 10px var(--card-shadow);
}

.icon-btn {
    width: 42px;
    height: 42px;
}

.lang-btn {
    min-width: 52px;
    height: 42px;
    padding: 0 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.icon-btn:hover,
.lang-btn:hover {
    transform: translateY(-1px);
}

.icon-btn:active,
.lang-btn:active {
    transform: translateY(0);
}

.scrim {
    position: fixed;
    inset: 0;
    background: var(--scrim-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 1050;
}

.scrim.show {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    max-width: min(88vw, 320px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 24px var(--card-shadow);
    transition: right var(--transition-base);
    z-index: 1100;
}

.sheet.open {
    right: 0;
}

.sheet-header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.sheet-body {
    padding: 20px;
    display: grid;
    gap: 12px;
}

.sheet-body a {
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

.sheet-body a:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.app-footer {
    padding: 18px 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    text-align: center;
}

[data-theme="dark"] .app-footer {
    background: rgba(20, 20, 20, 0.82);
}

.app-footer .container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.app-footer .container a {
    color: inherit;
    text-decoration: none;
    padding: 0 4px;
}

.app-footer .container a:hover {
    color: var(--primary-color);
}

.app-footer .divider {
    color: inherit;
}

@media (max-width: 768px) {
    .app-header {
        height: 68px;
        padding: 0 16px;
    }

    .brand {
        font-size: 1.2rem;
    }

    .nav-actions {
        gap: 8px;
    }

    .icon-btn,
    .lang-btn {
        border-radius: 10px;
        box-shadow: 0 2px 6px var(--card-shadow);
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .lang-btn {
        min-width: 48px;
        height: 38px;
        padding: 0 12px;
    }

    .page-offset {
        padding-top: 88px;
    }
}

@media (max-width: 480px) {
    .app-header {
        height: 64px;
        padding: 0 12px;
    }

    .brand {
        font-size: 1.1rem;
    }

    .icon-btn,
    .lang-btn {
        box-shadow: 0 1px 4px var(--card-shadow);
    }

    .app-footer .container {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 4px;
    }
}
