/**
 * college-list.css - 院校列表页面样式（campus-recruitment 风格侧边栏版）
 * 
 * 设计系统：
 * - 主色调：蓝色系（#3b82f6）
 * - 背景：浅灰色（#f5f7fa）
 * - 卡片：白色（#ffffff）
 * - 字体：Segoe UI / Microsoft YaHei
 */

/* ==================== CSS变量定义 ==================== */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e8ecf0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --accent-500: #6366f1;
    --accent-600: #4f46e5;
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-blue-dark: #2563eb;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: #f8fafc;
    color: var(--text-primary);
    line-height: 1.6;
    padding-left: 250px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    overflow: visible;
}

/* ==================== 左侧筛选侧边栏 ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: #ffffff;
    border-right: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
    z-index: 999;
    overflow-y: auto;
}

/* Logo 区域 */
.sidebar-logo {
    padding: 16px 10px 16px 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo .logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 12px;
}

.sidebar-logo .logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* 搜索框 */
.search-box {
    position: relative;
    margin-top: 12px;
    margin-bottom: 4px;
}

.search-box input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #f8fafc;
    color: #334155;
    outline: none;
    transition: all 0.25s ease;
}

.search-box input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box input::placeholder {
    color: #94a3b8;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
}

/* 筛选区（侧边栏） */
.filter-section {
    padding: 12px 10px;
}

/* 折叠面板复选框筛选 */
.attr-collapse {
    margin-bottom: 4px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.attr-collapse-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.attr-collapse-header:hover {
    background: #f1f5f9;
}

.attr-arrow {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.attr-arrow.collapsed {
    transform: rotate(-90deg);
}

.attr-title {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    flex: 1;
}

.attr-all {
    flex-shrink: 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #64748b;
}

.attr-all input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #3b82f6;
}

.attr-list {
    max-height: 150px;
    overflow-y: auto;
    padding: 2px 8px 4px 8px;
}

.attr-list.collapsed {
    display: none;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
}

.checkbox-item:hover {
    color: #3b82f6;
}

.checkbox-item input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.loading-sm {
    font-size: 11px;
    color: #94a3b8;
    padding: 6px 2px;
    text-align: center;
}

/* 筛选按钮 */
.filter-btn-group {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.filter-btn {
    flex: 1;
    padding: 8px 6px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.filter-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.filter-btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.filter-btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.filter-btn-secondary:hover {
    background: #e2e8f0;
}

/* 侧栏统计信息 */
.sidebar-stats {
    padding: 8px 0 0 0;
    display: flex;
    gap: 12px;
}

.stat-row {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.7;
    white-space: nowrap;
}

.stat-row span {
    color: #3b82f6;
    font-weight: 600;
    font-size: 13px;
}

/* ==================== 主内容区域 ==================== */
.main-content {
    padding: 24px 28px;
    min-height: 100vh;
}

/* ==================== 院校列表（数据行） ==================== */
.college-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 714px;
}

.college-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.college-row:hover {
    border-color: var(--accent-blue-light);
    background: #f8faff;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.08);
}

.college-row .cr-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-blue);
    flex-shrink: 0;
    width: 13em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.college-row:hover .cr-name {
    color: var(--accent-blue-dark);
}

.college-row .cr-sep {
    color: #cbd5e1;
    flex-shrink: 0;
}

.college-row .cr-type,
.college-row .cr-nature,
.college-row .cr-affiliation {
    font-size: 0.85rem;
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
}

.college-row .cr-city {
    font-size: 0.85rem;
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
    width: 10em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.college-row .cr-nature {
    color: #059669;
    font-weight: 500;
}

.college-row .cr-badges {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.college-row .cr-feature-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #eff6ff;
    color: #1d4ed8;
    white-space: nowrap;
}

.college-row .cr-affiliation {
    color: #94a3b8;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ==================== 分页 ==================== */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled):not(.active) {
    border-color: #3b82f6;
    color: #3b82f6;
}

.page-btn.active:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: 600;
}

.page-arrow {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 4px;
    font-size: 1rem;
    user-select: none;
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-jumper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    color: #475569;
    font-size: 0.95rem;
}

.page-jumper input {
    width: 56px;
    height: 40px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    font-size: 0.95rem;
    color: #475569;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.page-jumper input:focus {
    border-color: #3b82f6;
}

.page-jumper input::-webkit-outer-spin-button,
.page-jumper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ==================== 加载和错误状态 ==================== */
.loading {
    text-align: center;
    padding: 80px;
}

.spinner-border {
    width: 4rem;
    height: 4rem;
    color: var(--accent-blue);
    animation: spin 1s linear infinite;
}

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

.error-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.error-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 15px;
}

.error-message {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

.retry-btn {
    background: var(--accent-blue);
    border: none;
    border-radius: 30px;
    padding: var(--spacing-sm) 30px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal, 0.3s) ease;
}

.retry-btn:hover {
    background: var(--accent-blue-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    body {
        padding-left: 0;
        padding-top: 0;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .sidebar-logo .logo-link {
        margin-bottom: 0;
    }

    .main-content {
        padding: 16px;
    }

    .college-table {
        gap: 4px;
    }

    .college-row {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 4px 8px;
    }

    .college-row .cr-name {
        min-width: auto;
        width: 100%;
        margin-bottom: 2px;
    }

    .college-row .cr-badges {
        width: 100%;
        margin-top: 2px;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 12px;
    }

    .college-table {
        gap: 4px;
    }

    .college-row {
        padding: 8px 10px;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar {
        display: none;
    }

    body {
        padding-left: 0;
    }

    .main-content {
        padding: 0;
    }

    .college-row {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ==================== 行内对比按钮 ==================== */
.cr-compare-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #64748b;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-left: auto;
}
.cr-compare-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}
.cr-compare-btn.compared {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}
.cr-compare-btn.compared:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

/* ==================== 浮动对比按钮 ==================== */
.compare-fab-zone {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9999;
    padding: 30px 0 60px 100px;
    cursor: default;
}
.compare-fab:hover {
    transform: translateX(0);
}

.compare-fab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 80px;
    height: 96px;
    padding: 12px 6px;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translateX(calc(100% - 10px));
    user-select: none;
}
.compare-fab.active {
    background: linear-gradient(to right, #ef4444 0, #ef4444 10px, #fff 10px, #fff 100%);
}
.compare-fab.active:hover {
    background: #fff;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.2);
}
.compare-fab-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef2ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
}
.compare-fab-icon {
    width: 22px;
    height: 22px;
    fill: rgba(79, 70, 229, 0.12);
    stroke: #4f46e5;
    stroke-width: 2;
}
.compare-fab-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.compare-fab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    border: 2px solid #fff;
}

/* ==================== 辅助功能 ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --card-border: #000000;
    }
}
