/* 统一导航栏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 56px;
}

.header-brand {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 8px 0;
}

.header-brand i { font-size: 22px; opacity: 0.95; }
.header-brand:hover { opacity: 0.9; }

.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.nav-toggle:hover { background: rgba(255, 255, 255, 0.25); }

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    overflow: visible;
}

.header-nav .nav-link,
.header-nav .nav-trigger {
    color: white;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.header-nav .nav-link:hover,
.header-nav .nav-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-nav .nav-link i,
.header-nav .nav-trigger i {
    font-size: 13px;
    opacity: 0.9;
}

.header-nav .dropdown {
    position: relative;
    display: inline-block;
    z-index: 1002;
}

.header-nav .dropdown:hover,
.header-nav .dropdown:focus-within {
    z-index: 1003;
}

.header-nav .dropdown > .nav-trigger {
    cursor: pointer;
}

.header-nav .dropdown > .nav-trigger::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 2px;
    font-size: 11px;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.header-nav .dropdown:hover > .nav-trigger::after,
.header-nav .dropdown:focus-within > .nav-trigger::after {
    transform: rotate(180deg);
}

.header-nav .dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    min-width: 210px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
    z-index: 9999;
    animation: slideDown 0.18s ease-out;
    padding: 6px 0;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-nav .dropdown:hover .dropdown-content,
.header-nav .dropdown:focus-within .dropdown-content {
    display: block;
}

.header-nav .dropdown-content a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
    white-space: nowrap;
}

.header-nav .dropdown-content a:hover {
    background: #f0f3ff;
    color: #667eea;
    transform: none;
}

.header-nav .dropdown-content a.nav-action {
    color: #667eea;
    font-weight: 500;
}

.header-nav .dropdown-content a.nav-action:hover {
    background: #eef1ff;
}

.header-nav .dropdown-content a i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    color: #888;
}

.header-nav .dropdown-content a:hover i {
    color: #667eea;
}

.header-nav .dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 12px;
}

/* Mega 菜单 */
.header-nav .dropdown-mega .dropdown-mega-content {
    min-width: 380px;
    padding: 12px;
}

.header-nav .mega-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}

.header-nav .mega-menu-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    padding: 4px 12px 6px;
}

.header-nav .mega-menu-group a {
    padding: 9px 12px;
    border-radius: 6px;
}

.header-nav .mega-menu-group a:hover {
    padding-left: 12px;
}

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge i {
    font-size: 16px;
    flex-shrink: 0;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(33, 150, 243, 0.75);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.btn-refresh:hover:not(:disabled) {
    background: rgba(33, 150, 243, 0.95);
}

.btn-refresh:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(244, 67, 54, 0.75);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(244, 67, 54, 0.95);
    transform: none;
}

/* 角色徽章 */
.role-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.role-admin { background: #f44336; color: white; }
.role-pi { background: #ff9800; color: white; }
.role-experimenter { background: #4caf50; color: white; }

/* 响应式 */
@media (max-width: 1200px) {
    .header-content { padding: 0 16px; gap: 12px; }
    .header-brand { font-size: 16px; }
    .header-nav .nav-link,
    .header-nav .nav-trigger { padding: 7px 10px; font-size: 13px; }
    .user-badge { max-width: 140px; font-size: 12px; }
}

@media (max-width: 992px) {
    .nav-toggle { display: flex; }

    .header-content {
        flex-wrap: wrap;
        padding: 10px 16px;
        min-height: auto;
    }

    .header-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        order: 3;
        background: rgba(0, 0, 0, 0.12);
        border-radius: 10px;
        padding: 8px;
        margin-top: 4px;
    }

    .header-nav.nav-open { display: flex; }

    .header-nav .nav-link,
    .header-nav .nav-trigger {
        width: 100%;
        padding: 12px 14px;
        border-radius: 8px;
        justify-content: flex-start;
    }

    .header-nav .dropdown { width: 100%; }

    .header-nav .dropdown-content {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        margin: 2px 0 4px 12px;
        animation: none;
        min-width: unset;
        padding: 4px 0;
    }

    .header-nav .dropdown:not(.mobile-open) .dropdown-content { display: none !important; }
    .header-nav .dropdown.mobile-open .dropdown-content { display: block !important; }

    .header-nav .dropdown-content a {
        color: rgba(255, 255, 255, 0.95);
        padding: 10px 14px;
    }

    .header-nav .dropdown-content a:hover {
        background: rgba(255, 255, 255, 0.12);
        color: white;
    }

    .header-nav .dropdown-content a i { color: rgba(255, 255, 255, 0.7); }
    .header-nav .dropdown-content a.nav-action { color: #c8d4ff; }

    .header-nav .dropdown-divider { background: rgba(255, 255, 255, 0.15); }

    .header-nav .mega-menu-grid { grid-template-columns: 1fr; gap: 0; }
    .header-nav .mega-menu-title { color: rgba(255, 255, 255, 0.5); }

    .header-nav .dropdown > .nav-trigger::after { margin-left: auto; }

    .user-info {
        margin-left: auto;
        border-left: none;
        padding-left: 0;
    }

    .btn-refresh-text,
    .btn-logout-text { display: none; }
}

@media (max-width: 480px) {
    .header-brand-text { display: none; }
    .user-badge { display: none; }
}



/* 容器通用样式 */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
}

@media (max-width: 1200px) {
    .container {
        padding: 0 20px;
    }
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn i {
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.btn-info {
    background: #2196f3;
    color: white;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group label.required::after {
    content: ' *';
    color: #f44336;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination a:hover,
.pagination span:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-draft {
    background: #9e9e9e;
    color: white;
}

.status-active {
    background: #2196f3;
    color: white;
}

.status-completed {
    background: #4caf50;
    color: white;
}

.status-cancelled {
    background: #f44336;
    color: white;
}

/* 提示消息 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 18px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 页面标题 */
.page-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: #667eea;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state i {
    font-size: 80px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

/* 面包屑导航 */
.breadcrumb {
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #999;
    margin: 0 8px;
}

.breadcrumb .current {
    color: #333;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.toolbar h2 {
    font-size: 24px;
    color: #333;
}

/* 搜索栏 */
.search-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.search-group {
    flex: 1;
    min-width: 200px;
}

.search-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.search-group input,
.search-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}
