/* ============================================
   唯璐招聘系统 — 组件样式（不含导航栏与底部）
   导航栏 → header.css
   底部   → footer.css
   ============================================ */

/* ============================================
   组件：Cookie 横幅
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 20px 24px;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 0.875rem;
    animation: cookieSlideUp 0.4s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.cookie-banner a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner a:hover {
    color: #60a5fa;
}

@keyframes cookieSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 16px 20px;
        gap: 14px;
    }
}

/* ============================================
   组件：职位卡片（列表页/首页复用）
   ============================================ */
.job-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 0 3px 0;
    transition: height 0.3s ease;
}

.job-card:hover::before {
    height: 100%;
}

.job-card .card-body {
    padding: 22px 24px;
}

.job-card h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    transition: var(--transition);
    line-height: 1.4;
}

.job-card:hover h4 {
    color: var(--primary);
}

.job-card .salary {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--primary);
    white-space: nowrap;
}

.job-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.job-card .desc {
    margin-top: 12px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   组件：筛选栏
   ============================================ */
.filter-bar {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex-shrink: 0;
}

.filter-bar .form-input,
.filter-bar .form-select {
    padding: 9px 14px;
    font-size: 0.875rem;
    min-width: 140px;
    height: 40px;
}

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

@media (max-width: 768px) {
    .filter-bar {
        padding: 16px;
        gap: 10px;
    }

    .filter-bar .form-input,
    .filter-bar .form-select {
        min-width: 100%;
    }
}

/* ============================================
   组件：用户端侧边栏导航
   ============================================ */
.user-sidebar {
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    padding: 24px 0;
    flex-shrink: 0;
    min-height: calc(100vh - 64px);
}

.user-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.user-sidebar .nav-item:hover {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: transparent;
}

.user-sidebar .nav-item.active {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: var(--primary);
    font-weight: 600;
}

.user-sidebar .nav-item.danger {
    color: var(--danger);
}

.user-sidebar .nav-item.danger:hover {
    background: var(--danger-bg);
}

.user-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.user-content {
    flex: 1;
    padding: 32px 40px;
    min-width: 0;
    max-width: 100%;
}

.user-content-header {
    margin-bottom: 32px;
}

.user-content-header h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.user-content-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .user-layout {
        flex-direction: column;
    }

    .user-sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 12px 0;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .user-sidebar .nav-item {
        display: inline-flex;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    .user-sidebar .nav-item.active {
        border-bottom-color: var(--primary);
        border-left-color: transparent;
    }

    .user-content {
        padding: 20px 16px;
    }

    .user-content-header {
        margin-bottom: 24px;
    }
}

/* ============================================
   组件：管理后台侧边栏
   ============================================ */
.admin-sidebar {
    width: 220px;
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
    -webkit-overflow-scrolling: touch;
}

.admin-sidebar-brand {
    padding: 20px 20px 24px;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.02em;
}

.admin-sidebar-brand span {
    display: block;
    font-size: 0.6875rem;
    font-family: var(--font-body);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
    letter-spacing: 0;
}

/* ---- 管理后台导航 ---- */
.admin-nav {
    padding: 16px 0;
}

.admin-nav .nav-label {
    padding: 16px 20px 6px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.admin-nav .nav-label:first-child {
    padding-top: 8px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.admin-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: transparent;
}

.admin-nav a.active {
    color: #ffffff;
    background: rgba(26, 115, 232, 0.2);
    border-left-color: var(--primary);
    font-weight: 600;
}

.admin-nav a.divider-top {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- 管理后台主区域 ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

.admin-main {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

.admin-topbar {
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-topbar .breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.admin-topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.admin-topbar .user-info img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.admin-body {
    padding: 28px 32px;
}

.admin-page-title {
    font-size: 1.5rem;
    font-family: var(--font-display);
    margin-bottom: 24px;
    line-height: 1.3;
}

/* ---- 数据统计卡片 ---- */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
    line-height: 1;
}

.stat-card .stat-change {
    font-size: 0.8125rem;
    margin-top: 10px;
    font-weight: 500;
}

/* ---- 数据表格 ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: var(--surface-hover);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover td {
    background: var(--surface-hover);
}

.data-table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.data-table a {
    font-weight: 500;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-topbar {
        padding: 0 16px;
    }

    .admin-body {
        padding: 16px;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   组件：统计图表容器
   ============================================ */
.chart-container {
    width: 100%;
    min-height: 300px;
    position: relative;
}

.chart-container .chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   组件：进度条
   ============================================ */
.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   组件：徽标 / 计数气泡
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 10px;
    line-height: 1;
}

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

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

.badge-muted {
    background: var(--border);
    color: var(--text-muted);
}

/* ============================================
   组件：空状态
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state .empty-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state .empty-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ============================================
   组件：操作提示横幅
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(26, 115, 232, 0.15);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(13, 148, 136, 0.15);
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ============================================
   组件：下拉选择增强（带搜索感）
   ============================================ */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
}

.select-wrapper .form-select {
    appearance: none;
    padding-right: 36px;
}

/* ============================================
   组件：文件上传区
   ============================================ */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-area .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.upload-area .upload-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-area .upload-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   组件：标签输入 / 标签选择
   ============================================ */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-selector label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--surface-hover);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    -webkit-user-select: none;
}

.tag-selector label:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.tag-selector label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-inverse);
}

.tag-selector input[type="checkbox"] {
    display: none;
}

/* ============================================
   组件：头像
   ============================================ */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
}

.avatar-sm {
    width: 28px;
    height: 28px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
}

.avatar-xl {
    width: 72px;
    height: 72px;
    border-width: 3px;
}

/* ============================================
   组件：分割线
   ============================================ */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: 20px 0;
    border: none;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin: 24px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

/* ============================================
   组件：加载指示器
   ============================================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页面级 Loading 覆盖层 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.loading-overlay .loading-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   组件：文字截断工具
   ============================================ */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}