/*
 * Automator-Orchestrator 中台管理界面样式
 * 简洁实用的设计风格
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ========== 导航栏 ========== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 600;
    padding: 18px 0;
    color: white;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: opacity 0.3s;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 5px;
    align-items: center;
}

.nav-link {
    display: block;
    padding: 18px 20px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: white;
    border-radius: 3px 3px 0 0;
}

/* 下拉菜单样式 */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > .nav-link {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    list-style: none;
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #667eea;
    padding-left: 24px;
}

/* 用户信息区域 */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-display {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* ========== 页面标题 ========== */
.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #f0f0f0;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.page-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: 700;
}

.page-subtitle {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* ========== 卡片 ========== */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63398e 100%);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0d8075 0%, #2dd368 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d50865 0%, #e65c00 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e081ec 0%, #e4495d 100%);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* ========== 表格 ========== */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

thead {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e8ecf1;
}

th {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: #f8fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========== 状态标签 ========== */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.status-online {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b1dfbb;
}

.status-offline {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #383d41;
    border: 1px solid #c6c8ca;
}

.status-busy {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffe69c;
}

.status-attention {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
    animation: pulse 2s infinite;
}

.status-pending {
    background: linear-gradient(135deg, #cce5ff 0%, #b8daff 100%);
    color: #004085;
    border: 1px solid #a0cfff;
}

.status-running {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffe69c;
}

.status-completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b1dfbb;
}

.status-failed {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.95rem;
    height: 45px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:hover {
    border-color: #cbd5e0;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    height: auto;
}

select.form-control {
    cursor: pointer;
}

input[type="file"].form-control {
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

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

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== Modal弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-title {
    font-size: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.modal-close {
    background: #f5f7fa;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e1e8ed;
    color: #2c3e50;
    transform: rotate(90deg);
}

.modal-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========== 通知消息 ========== */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

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

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

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

/* ========== Tab切换 ========== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    position: relative;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #3498db;
}

.tab-button.active {
    color: #3498db;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3498db;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-nav {
        width: 100%;
        flex-direction: column;
    }

    .nav-link {
        width: 100%;
    }

    /* 移动端下拉菜单样式 */
    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-dropdown.active .dropdown-menu {
        max-height: 300px;
    }

    .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding-left: 40px;
    }

    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.15);
        color: white;
        padding-left: 44px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
}
