:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --bg-white: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f8fafc;
    color: var(--text-primary);
    line-height: 1.6;
    padding-left: 250px;
    padding-bottom: 40px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 左侧垂直目录 ==================== */
.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;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* Logo区域（在左侧目录顶部） */
.sidebar-logo {
    padding: 16px 10px 16px 10px;
    border-bottom: 1px solid var(--border-color);
}

/* 左侧目录统计信息 */
.sidebar-stats {
    padding: 12px 10px 0px 10px;
}

.stat-row {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.8;
}

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

.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;
}

/* 类型切换器（在左侧目录中） */
.sidebar-logo .type-switcher {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

/* 类型切换按钮 */
.type-btn {
    flex: 1;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-align: center;
}

.type-btn:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.type-btn.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* 独立新增按钮容器 */
.add-btn-container {
    margin-top: 10px;
    margin-bottom: 4px;
}

/* 独立新增按钮 */
.add-major-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.add-major-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.add-major-btn:active {
    transform: translateY(0);
}

.add-major-btn.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.4);
}

.add-major-btn svg {
    width: 16px;
    height: 16px;
}

/* 搜索框 */
.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;
}

.sidebar-header {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), transparent);
}

.sidebar-nav {
    padding: 8px 0;
}

/* 门类筛选标签（垂直布局） */
.category-item {
    display: block;
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    font-family: inherit;
    line-height: 1.5;
    text-align: left;
    white-space: nowrap;
}

.category-item:hover {
    color: #3b82f6;
    background: #eff6ff;
    border-left-color: #3b82f6;
}

.category-item.active {
    color: #3b82f6;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.08);
    border-left-color: #3b82f6;
    box-shadow: none;
}

/* 门类组（包含二级菜单） */
.category-group {
    width: 100%;
}

/* 门类按钮内箭头布局 */
.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* 二级菜单 */
.sub-menu {
    padding: 2px 0 2px 0;
}

/* 专业类子项 */
.sub-item {
    display: block;
    width: 100%;
    padding: 8px 20px 8px 32px;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    font-family: inherit;
    line-height: 1.5;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-item:hover {
    color: #3b82f6;
    background: #eff6ff;
    border-left-color: #93c5fd;
}

.sub-item.active {
    color: #3b82f6;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.08);
    border-left-color: #3b82f6;
}

/* 统计信息 */
.header-stats {
    display: flex;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 400;
}

/* 页头 */
.page-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.page-subtitle #totalCount {
    color: var(--primary-color);
    font-weight: 600;
}

/* 搜索栏 */
.search-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.total-badge {
    font-size: 14px;
    color: var(--text-secondary);
}

.total-badge span {
    color: var(--primary-color);
    font-weight: 600;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    width: 300px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-count {
    font-size: 14px;
    color: var(--text-muted);
}

.search-count span:first-child {
    color: var(--primary-color);
}

.search-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--primary-hover);
}

/* 专业列表容器 */
#majorList {
    padding: 20px 24px;
}

/* 专业列表 */
.major-category-section {
    margin-bottom: 32px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), transparent);
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-title .category-code {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

.category-stats {
    font-size: 13px;
    color: var(--text-muted);
}

.category-stats span {
    color: var(--primary-color);
    font-weight: 500;
}

/* 专业类列表 */
.major-class-list {
    padding: 0 20px 20px;
}

.major-class-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.major-class-item:last-child {
    border-bottom: none;
}

.major-class-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.major-class-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.major-class-code {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 8px;
}

.major-class-count {
    font-size: 13px;
    color: var(--primary-color);
    margin-left: auto;
    font-weight: 500;
}

/* 专业网格 */
.major-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.major-item {
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.major-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.major-item.clicked {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.15s;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 80px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

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

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

/* 响应式 */
@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;
    }

    .major-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .page-title {
        font-size: 22px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .major-grid {
        grid-template-columns: 1fr;
    }
}

/* 新增专业标签 */
.new-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

/* 年份筛选器 */
.year-filter {
    display: flex;
    gap: 5px;
}

.year-filter .btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
}
