/* Employment.guru — shared layout */
:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-light: #eff6ff;
    --primary-border: #93c5fd;
    --surface: #ffffff;
    --bg: #f8fafc;
    --text: #0b1220;
    --text-muted: #5b6b82;
    --text-soft: #8b98ac;
    --border: #dbe3ef;
    --success: #047857;
    --success-bg: #ecfdf5;
    --success-border: #6ee7b7;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --warning-border: #fcd34d;
    --muted: #334155;
    --muted-bg: #f8fafc;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-card-hover: 0 12px 28px rgba(15, 23, 42, 0.1);
    --nav-height: 72px;
    --content-max: 1100px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* —— Header —— */
.site-nav {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 200;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.site-nav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand img {
    width: 44px;
    height: 44px;
    display: block;
}

.brand-text,
.brand > span:not(.brand-cn):not(.brand-en) {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-cn {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.02em;
}

.brand-en {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.site-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-nav-link {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 4px;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.site-nav-link:hover {
    color: var(--primary);
}

.site-nav-link.is-active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-nav:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.24);
}

/* —— Footer —— */
.site-footer {
    max-width: var(--content-max);
    margin: 40px auto 0;
    padding: 24px 16px 32px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.site-footer-copy {
    margin: 0 0 12px;
    font-size: 13px;
    color: #475569;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 4px;
}

.site-footer-nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
}

.site-footer-nav a:hover {
    text-decoration: underline;
}

.site-footer-sep {
    color: #cbd5e1;
    user-select: none;
}

/* —— Buttons —— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: #fff;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: #93c5fd;
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* —— Loading skeleton —— */
.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    margin-bottom: 10px;
}

.skeleton-line.title {
    height: 20px;
    width: 85%;
}

.skeleton-line.short {
    width: 45%;
}

@keyframes skeleton-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.65;
    }
}

/* —— Modal (shared) —— */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    z-index: 300;
    padding: 24px 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-backdrop.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

@supports (-webkit-touch-callout: none) {
    .job-card {
        -webkit-tap-highlight-color: rgba(29, 78, 216, 0.12);
    }
}

.modal {
    background: #fff;
    border-radius: 14px;
    max-width: 640px;
    width: 100%;
    padding: 28px;
    margin: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    outline: none;
}

.modal-close {
    float: right;
    border: none;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.modal-close:hover {
    background: #e2e8f0;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

/* iOS Safari: avoid zoom on focus when font-size < 16px */
@media (max-width: 768px) {
    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    .btn-nav,
    .filter-chip,
    button.small {
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .site-nav-inner {
        padding: 0 12px;
    }

    .brand-cn {
        font-size: 1.1rem;
    }

    .btn-nav {
        padding: 8px 14px;
        font-size: 13px;
    }
}
