/* 
 * YusenTek Admin Styles
 * Standardizing the industrial automation brand identity for the admin dashboard
 */

:root {
    --admin-bg: #f4f7f6;
    --admin-sidebar-width: 240px;
    --admin-header-height: 70px;
    --admin-card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body {
    background-color: var(--admin-bg);
    color: #333;
}

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: #1a202c;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 25px 30px;
    font-size: 24px;
    font-weight: 800;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand a {
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

.sidebar-brand span {
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 30px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-nav a .icon {
    margin-right: 12px;
    font-style: normal;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.05);
    border-left: 4px solid var(--primary-color);
    padding-left: 26px;
}

/* 侧边栏导航已移除 footer，相关样式已转移至 header */

/* 主内容区 */
.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--admin-bg);
}

.admin-header {
    height: var(--admin-header-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 90;
}

.admin-header .page-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #2d3748;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions .btn-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.header-actions .btn-link:hover {
    color: var(--primary-color);
}

.header-actions .logout:hover {
    color: #e53935;
}

.header-actions .divider {
    color: #e2e8f0;
    font-size: 12px;
}

.user-info {
    font-size: 14px;
    color: #4a5568;
    padding-left: 20px;
    border-left: 1px solid #e2e8f0;
}

.user-info strong {
    color: var(--secondary-color);
    margin-left: 4px;
}

.admin-content {
    padding: 30px;
    flex: 1;
}

.container-fluid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-footer {
    padding: 20px 30px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
}

/* 移除旧的导航栏样式 */
.admin-navbar { display: none; }

/* 后台卡片 */
.admin-card { 
    background: var(--white); 
    border-radius: var(--radius-md); 
    box-shadow: var(--admin-card-shadow); 
    padding: 25px; 
    margin-bottom: 25px; 
    border: 1px solid var(--border-color); 
    transition: var(--transition);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-container {
    background: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal-header {
    padding: 20px 25px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--secondary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: #e53935;
}

.modal-body {
    padding: 25px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 25px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.table-thumb {
    cursor: pointer;
    transition: var(--transition);
}

.table-thumb:hover {
    transform: scale(1.1);
}

.welcome-card {
    background: linear-gradient(135deg, var(--secondary-color), #2c3e50);
    color: #fff;
    padding: 40px;
    margin-bottom: 30px;
}

.welcome-title {
    margin: 0;
    font-weight: 800;
}

.welcome-subtitle {
    margin: 10px 0 0 0; 
    opacity: 0.8;
}

/* 统计卡片 */
.stat-row {
    margin-bottom: 20px;
}

.stat-row [class*="col-"] {
    margin-bottom: 25px;
}

.stat-card {
    text-align: left;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-icon {
    font-size: 24px; 
    margin-bottom: 8px;
    background: #f8f9fa;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.stat-label {
    font-size: 14px; 
    color: var(--text-muted); 
    margin-bottom: 0;
    font-weight: 600;
}

.stat-value {
    font-size: 28px; 
    font-weight: 800; 
    color: var(--secondary-color);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-footer {
    margin-top: auto;
}

.stat-footer .btn-block {
    margin-top: 10px;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px;
}

.unread-badge {
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
}

.stat-card.highlight {
    border-top: 3px solid #e53935;
}

/* 页面标题区 */
.page-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
}

.page-header h2 { 
    margin: 0; 
    font-size: 24px; 
    color: var(--secondary-color); 
    font-weight: 800;
}

/* 表格样式美化 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.admin-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tr:hover {
    background-color: #fcfcfc;
}

/* 按钮扩展 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    gap: 8px;
    line-height: 1.5;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
    text-align: center;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-primary { 
    background: var(--primary-color); 
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(229, 57, 53, 0.2);
}
.btn-primary:hover { 
    background: #d32f2f; 
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(229, 57, 53, 0.3);
    transform: translateY(-2px);
}

.btn-success { 
    background: #10b981; 
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}
.btn-success:hover { 
    background: #059669; 
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn-info { 
    background: #3b82f6; 
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}
.btn-info:hover { 
    background: #2563eb; 
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.btn-warning { 
    background: #f59e0b; 
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2);
}
.btn-warning:hover { 
    background: #d97706; 
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

.btn-danger { 
    background: #ef4444; 
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { 
    background: #dc2626; 
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.btn-default { 
    background: #fff; 
    color: #4a5568; 
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-default:hover { 
    background: #f8fafc; 
    color: #1a202c;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

/* 状态标签 */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #e6f4ea; color: #1e7e34; }
.badge-warning { background: #fff4e5; color: #b45d00; }
.badge-danger { background: #fdeaea; color: #c82333; }

/* 搜索与卡片工具栏 */
.toolbar-card {
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.search-input {
    width: 300px !important;
}

.select-input {
    width: 200px !important;
}

/* 表格缩略图 */
.table-thumb {
    height: 40px;
    width: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* 状态样式 */
.status-featured {
    color: var(--primary-color);
    font-weight: 700;
}

/* 表单容器布局 */
.form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

.form-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-actions-no-border {
    border-top: none;
    padding-top: 0;
    margin-top: 15px;
}

/* 提示框 */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* 登录页样式 */
.login-body {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.login-card-wrapper {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 48px 40px;
    border: none;
    position: relative;
    overflow: hidden;
}

.login-card-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    color: #1a202c;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header h1 span {
    color: var(--primary-color);
}

.login-header p {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
}

.login-card-wrapper .form-group {
    margin-bottom: 20px;
}

.login-card-wrapper .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.login-card-wrapper .form-control {
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
}

.login-card-wrapper .form-control:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    outline: none;
}

.login-card-wrapper .btn-primary {
    height: 44px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    margin-top: 10px;
    box-shadow: 0 4px 6px -1px rgba(229, 57, 53, 0.2);
    transition: all 0.2s;
}

.login-card-wrapper .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(229, 57, 53, 0.3);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 13px;
    color: #a0aec0;
    border-top: 1px solid #edf2f7;
    padding-top: 24px;
}

/* 后台页脚 */
.admin-footer {
    margin-top: 60px;
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

.checkbox-group {
    margin-top: 15px;
}

.checkbox-group .form-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 图片预览 */
.image-preview {
    margin-top: 10px;
}

.image-preview img {
    max-height: 120px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* 空状态文本 */
.text-muted-light {
    color: #ccc;
}

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

.admin-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-main);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.admin-pagination .page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

.admin-pagination .page-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* 响应式适配 */
@media (max-width: 992px) {
    .form-row {
        flex-direction: column;
    }
    
    .search-input {
        width: 100% !important;
    }
    
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .admin-navbar .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .admin-menu {
        margin: 15px 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-menu a {
        padding: 10px 15px;
        height: auto;
        border-bottom: none;
    }
    
    .admin-menu a.active {
        border-radius: 4px;
    }
    
    .stat-card.highlight {
        background-color: var(--primary-light);
        border-color: var(--primary-color);
    }
    
    .stat-card {
        margin-bottom: 20px;
    }
}
