/* ============================================
   唯璐招聘系统 (Velu Job) — 全局样式
   ============================================ */

:root {
    /* 主色系：深邃蓝黑 + 活力蓝 */
    --bg:               #fafbfc;
    --bg-dark:          #0f1419;
    --surface:          #ffffff;
    --surface-hover:    #f5f7fa;
    --border:           #e8ecf0;
    --border-light:     #f0f2f5;

    --primary:          #3ba55d;
    --primary-hover:    #2e8b4f;
    --primary-light:    #eaf7ee;
    --primary-bg:       rgba(59,165,93),0.06);

    --accent:           #5fbf7a;
    --accent-hover:     #2e8b4f;
    --success:          #0d9488;
    --success-bg:       #f0fdfa;
    --warning:          #f59e0b;
    --warning-bg:       #fffbeb;
    --danger:           #ef4444;
    --danger-bg:        #fef2f2;

    --text:             #1a1a2e;
    --text-secondary:   #5f6368;
    --text-muted:       #9aa0a6;
    --text-inverse:     #ffffff;

    --shadow-sm:        0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:        0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:        0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl:        0 20px 60px rgba(0,0,0,0.15);

    --radius-sm:        6px;
    --radius-md:        10px;
    --radius-lg:        16px;
    --radius-xl:        24px;

    --transition:       all 0.2s cubic-bezier(0.4,0,0.2,1);
    --font-display:     'Noto Serif SC', 'Source Han Serif SC', serif;
    --font-body:        'Noto Sans SC', 'Source Han Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
}

/* ---- 噪点纹理叠加 ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

/* ============================================
   组件：按钮
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text-inverse);
    box-shadow: 0 4px 14px rgba(59,165,93),0.35);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-inverse);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: var(--text-inverse);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1.0625rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   组件：表单
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

/* ============================================
   组件：卡片
   ============================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--surface-hover);
}

/* ============================================
   组件：标签
   ============================================ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.tag-primary   { background: var(--primary-light); color: var(--primary); }
.tag-success   { background: var(--success-bg); color: var(--success); }
.tag-warning   { background: var(--warning-bg); color: var(--warning); }
.tag-danger    { background: var(--danger-bg); color: var(--danger); }
.tag-muted     { background: #f1f3f4; color: var(--text-muted); }

/* ============================================
   组件：Toast 提示
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9375rem;
    animation: toastIn 0.35s ease forwards;
    max-width: 380px;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   组件：骨架屏
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
    width: 100%;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.shorter { width: 40%; }

.skeleton-card {
    height: 160px;
    border-radius: var(--radius-md);
}

/* ============================================
   组件：分页
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    margin: 32px 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}

.page-link:hover {
    background: var(--surface-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.page-dots {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0 4px;
}

/* ============================================
   组件：弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 480px;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 28px 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-body {
    padding: 20px 28px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.modal-footer {
    padding: 0 28px 24px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================
   组件：时间轴
   ============================================ */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -27px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid var(--bg);
}

.timeline-item.active .timeline-dot,
.timeline-item.completed .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.timeline-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 0.9375rem;
    font-weight: 500;
}

.timeline-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================
   工具类
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--primary); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* 入场动画 */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.fade-in:nth-child(2) { animation-delay: 0.08s; }
.fade-in:nth-child(3) { animation-delay: 0.16s; }
.fade-in:nth-child(4) { animation-delay: 0.24s; }
.fade-in:nth-child(5) { animation-delay: 0.32s; }
.fade-in:nth-child(6) { animation-delay: 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.125rem; }

    .container { padding: 0 16px; }
    .container-sm { padding: 0 16px; }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .btn-lg {
        padding: 12px 24px;
    }

    .card-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }
}