/* ==================== 全局样式 ==================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Montserrat:wght@400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

::selection {
    background: rgba(0, 230, 230, 0.3);
    color: #ffffff;
}

/* ==================== 动画 ====================  */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== 导航栏 ==================== */
.navbar {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    padding: 15px 30px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(0, 230, 230, 0.2);
}

.navbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-row-top {
    margin-bottom: 15px;
    position: relative;
}

.navbar-row-bottom {
    padding-top: 12px;
    border-top: 1px solid rgba(0, 230, 230, 0.15);
}

.navbar-brand .logo {
    color: #00e6e6;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(0, 230, 230, 0.3);
}

.navbar-brand .logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(0, 230, 230, 0.5);
}

.navbar-brand .logo i {
    font-size: 24px;
}

.navbar-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    margin: 0 20px;
}

.navbar-menu::-webkit-scrollbar {
    display: none;
}

.nav-links {
    display: flex;
    gap: 6px;
    list-style: none;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
    flex-shrink: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-links a:hover {
    background: rgba(0, 230, 230, 0.12);
    color: #00e6e6;
    transform: translateY(-2px);
    border-color: rgba(0, 230, 230, 0.3);
    box-shadow: 0 2px 8px rgba(0, 230, 230, 0.2);
}

.nav-links a.active {
    background: linear-gradient(135deg, #00e6e6, #00b8b8);
    color: #0a0a0a;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 230, 230, 0.4);
    border-color: #00e6e6;
}

.nav-links a i {
    font-size: 14px;
}

/* 禁用导航（脚本未加载完成时） */
.nav-links.disabled a {
    pointer-events: none;
    opacity: 0.6;
    filter: grayscale(30%);
}

/* 用户信息 */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.user-name {
    font-size: 14px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 230, 230, 0.08);
    border: 1px solid rgba(0, 230, 230, 0.2);
    border-radius: 25px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.user-name:hover {
    background: rgba(0, 230, 230, 0.15);
    border-color: rgba(0, 230, 230, 0.4);
}

.user-name i {
    font-size: 16px;
    color: #00e6e6;
}

.btn-logout {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    color: #ffffff;
    padding: 8px 18px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #ff3838, #ff1744);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.5);
}

.btn-logout i {
    font-size: 14px;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1400px;
    margin: 120px auto 30px;
    padding: 20px 40px;
}

/* ==================== 卡片通用样式 ==================== */
.card {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 230, 230, 0.2);
}

.card-title {
    font-size: 22px;
    font-weight: 600;
    color: #00e6e6;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid rgba(0, 230, 230, 0.3);
    padding-bottom: 10px;
}

/* ==================== 表单控件 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #e0e0e0;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    height: 40px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #00e6e6;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(0, 230, 230, 0.1);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

select.form-control {
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    color: #00e6e6;
    font-weight: 500;
    height: 40px;
    padding: 10px 14px;
}

/* 并发任务数下拉框特殊样式 - 确保文字显示完整 */
#train-concurrent {
    min-width: 280px;
    width: 100%;
}

/* 下拉菜单选项样式 */
select.form-control option {
    background: #0f0f1e;  /* 更深的背景 */
    color: #00e6e6;
    padding: 10px;
    font-weight: 500;
}

select.form-control option:hover {
    background: #1a1a2e;
    color: #ffffff;
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    height: 40px;
    min-width: 90px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #ffffff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38ef7d, #11998e);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #e91e63);
    color: #ffffff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e91e63, #f44336);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: #ffffff;
}

.btn-info {
    background: linear-gradient(135deg, #00e6e6, #0097a7);
    color: #ffffff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 表格样式 ==================== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table thead {
    background: rgba(0, 230, 230, 0.1);
}

.table th {
    padding: 15px;
    text-align: left;
    color: #00e6e6;
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 230, 230, 0.3);
}

/* 表头居中 */
.table th[style*="text-align: center"] {
    text-align: center !important;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(0, 230, 230, 0.08);
    transform: translateX(2px);
    box-shadow: -2px 0 0 0 rgba(0, 230, 230, 0.5), 0 1px 4px rgba(0, 230, 230, 0.1);
}

/* ==================== 徽章样式 ==================== */
.badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.badge-success {
    background: #38ef7d;
    color: #000;
}

.badge-danger {
    background: #f44336;
    color: #fff;
}

.badge-warning {
    background: #ff9800;
    color: #000;
}

.badge-info {
    background: #00e6e6;
    color: #000;
}

.badge-secondary {
    background: #6c757d;
    color: #fff;
}

.badge-offline {
    background: #fd7e14;
    color: #fff;
}

/* ==================== 进度条 ==================== */
.progress-bar {
    width: 100%;
    height: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== 提示框 ==================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-info {
    background: rgba(0, 230, 230, 0.15);
    border-left: 4px solid #00e6e6;
    color: #00e6e6;
}

.alert-success {
    background: rgba(56, 239, 125, 0.15);
    border-left: 4px solid #38ef7d;
    color: #38ef7d;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.15);
    border-left: 4px solid #ff9800;
    color: #ff9800;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.15);
    border-left: 4px solid #f44336;
    color: #f44336;
}

/* ==================== 加载动画 ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00e6e6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Tab切换隐藏 ==================== */
.tab-pane {
    display: none;
    animation: fadeIn 0.5s;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 响应式 ==================== */
@media (max-width: 1440px) {
    .navbar {
        padding: 18px 15px;
    }
    
    .navbar-menu {
        margin: 0 8px;
    }
    
    .nav-links {
        gap: 3px;
    }
    
    .nav-links a {
        padding: 10px 9px;
        font-size: 14px;
    }
    
    .navbar-user {
        min-width: 340px;
    }
}

@media (max-width: 1280px) {
    .navbar-brand .logo {
        font-size: 20px;
        min-width: 140px;
    }
    
    .navbar-menu {
        margin: 0 6px;
    }
    
    .nav-links {
        gap: 2px;
    }
    
    .nav-links a {
        font-size: 14px;
        padding: 9px 8px;
    }
    
    .navbar-user {
        min-width: 320px;
    }
    
    .container {
        padding: 20px 30px;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 15px 20px;
        margin-top: 90px;
    }
    
    .navbar {
        padding: 15px 12px;
        min-height: 65px;
    }
    
    .navbar-brand .logo {
        font-size: 18px;
        min-width: 120px;
    }
    
    .navbar-menu {
        margin: 0 5px;
    }
    
    .nav-links a {
        font-size: 13px;
        padding: 8px 7px;
    }
    
    .user-name {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .btn-logout {
        font-size: 13px;
        padding: 7px 14px;
    }
    
    .navbar-user {
        min-width: 300px;
        margin-right: 140px;
    }
    
    /* 表格响应式 */
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
    }
    
    /* 表单响应式 */
    .form-row,
    .form-row-training {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .form-group-btn {
        grid-column: 1 / -1;
    }
    
    /* 状态卡片 */
    .status-card {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 12px 10px;
        min-height: auto;
    }
    
    .navbar-brand {
        order: 1;
        flex: 0 0 auto;
    }
    
    .navbar-brand .logo {
        font-size: 16px;
        min-width: 100px;
    }
    
    .navbar-user {
        order: 2;
        flex: 0 0 auto;
        min-width: auto;
        margin-right: 0;
        margin-left: auto;
    }
    
    .user-name {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .btn-logout {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .navbar-menu {
        order: 3;
        width: 100%;
        margin: 10px 0 0 0;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
    }
    
    .nav-links a {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .container {
        margin-top: 140px;
        padding: 15px;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    /* 表单全部单列 */
    .form-row,
    .form-row-training {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 状态卡片 */
    .status-card {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* 表格滚动 */
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    .navbar-brand .logo {
        font-size: 14px;
        min-width: 80px;
    }
    
    .nav-links a {
        font-size: 12px;
        padding: 7px 8px;
    }
    
    .user-name span {
        display: none;
    }
    
    .btn-logout {
        padding: 6px 10px;
    }
    
    .btn-logout i {
        margin-right: 0;
    }
    
    .btn-logout .fa-sign-out-alt + * {
        display: none;
    }
    
    .status-card {
        grid-template-columns: 1fr;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}
