/* 全局样式 */
:root {
    --primary-color: #007bff; /* 蓝色主题 */
    --secondary-color: #6c757d; /* 灰色强调 */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --border-radius: 10px;
    --box-shadow: 0 4px 20px rgba(0, 123, 255, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark-color);
    line-height: 1.6;
}

/* 登录页面样式 */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* 登录页面美化 */
#login-page {
    background: linear-gradient(135deg, #667eea 0%, #007bff 100%);
    position: relative;
    overflow: hidden;
}

#login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/mn.jpg') center/cover no-repeat;
    opacity: 0.3;
    z-index: 1;
}

#login-page > div {
    position: relative;
    z-index: 2;
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

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

#login-form .form-control {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 18px;
    font-size: 16px;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.95);
}

#login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

#login-form button {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#login-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-bottom: none;
    font-weight: 600;
    padding: 20px;
}

/* 后台管理页面样式 */
#admin-page {
    background-color: #f0f2f5;
}

/* 导航栏美化 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

.navbar-nav .nav-link:hover {
    color: white;
    transform: translateY(-1px);
}

/* 侧边栏美化 */
.sidebar {
    height: calc(100vh - 72px); /* 减去导航栏高度 */
    overflow-y: auto;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border-right: 1px solid #e9ecef;
}

.sidebar:hover {
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
}

.sidebar .nav-link {
    color: var(--gray-color);
    padding: 12px 20px;
    transition: var(--transition);
    border-radius: 0 25px 25px 0;
    margin: 2px 0;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.15), transparent);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    font-weight: 600;
}

/* 主内容区域样式 */
main {
    height: calc(100vh - 72px); /* 减去导航栏高度 */
    overflow-y: auto;
    padding-bottom: 40px;
    background-color: #f0f2f5;
}

/* 模块标题美化 */
h2 {
    color: var(--dark-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 2px;
}

/* 卡片美化 */
.module-container .card {
    background-color: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 20px;
}

.module-container .card-header {
    background-color: white;
    color: var(--dark-color);
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-container .card-body {
    padding: 20px;
}

/* 表格美化 */
.table {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: center;
    padding: 15px;
    border-bottom: 2px solid #e9ecef;
    color: var(--gray-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #f1f3f5;
    transition: var(--transition);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(111, 66, 193, 0.03);
    transform: translateY(-1px);
}

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

/* 按钮样式美化 */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #218838);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    color: var(--dark-color);
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-buttons .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: normal;
}

/* 表单样式美化 */
.form-control {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 10px 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.1);
    outline: none;
}

.form-select {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 10px 15px;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* 模态框美化 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-bottom: none;
    padding: 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* 图片样式 */
.product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.product-image:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 状态标签样式 */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.available {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-badge.occupied {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.status-badge.cleaning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-container {
    animation: fadeIn 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        width: 250px;
        left: -250px;
        top: 72px;
        height: calc(100vh - 72px);
        transition: var(--transition);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 123, 255, 0.3);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 123, 255, 0.5);
}

/* 工具提示样式 */
.tooltip {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 500;
}

/* 面包屑样式 */
.breadcrumb {
    background-color: white;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: #5a37a0;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--gray-color);
    font-weight: 600;
}