/* 全局样式 */
:root {
    /* 主要颜色 */
    --primary-color: #4e73df;
    --primary-dark: #3a56b0;
    --secondary-color: #1cc88a;
    --secondary-dark: #169e6c;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --info-color: #36b9cc;
    --dark-color: #5a5c69;
    --light-color: #f8f9fc;
    --grey-color: #858796;

    /* 功能色 */
    --sidebar-bg: #4e73df;
    --sidebar-dark: #3a56b0;
    --topbar-bg: #ffffff;
    --card-border: #e3e6f0;

    /* 文字颜色 */
    --text-dark: #333333;
    --text-muted: #6c757d;
    --text-light: #f8f9fc;

    /* 阴影 */
    --box-shadow: 0 .15rem 1.75rem 0 rgba(58, 59, 69, .15);
    --box-shadow-sm: 0 .125rem .25rem 0 rgba(58, 59, 69, .1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: #f8f9fc;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

/* 通用组件 */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.9;
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn:disabled {
    opacity: 0.65;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: var(--grey-color);
    border-color: var(--grey-color);
    color: white;
}

.btn-success {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

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

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

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

.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    color: #fff;
    background-color: var(--secondary-color);
}

.badge-warning {
    color: #212529;
    background-color: var(--warning-color);
}

.badge-danger {
    color: #fff;
    background-color: var(--danger-color);
}

/* 登录页面样式 */
.login-page {
    background: linear-gradient(120deg, #4e73df 0%, #224abe 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--card-border);
}

.login-header .logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.login-header h1 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    color: var(--primary-dark);
}

.login-form {
    padding: 2rem;
}

.login-form .form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.login-form .form-group label {
    position: absolute;
    left: 0.75rem;
    top: 0.375rem;
    color: var(--grey-color);
}

.login-form .form-group input {
    padding-left: 2.5rem;
}

.login-form button {
    margin-top: 1rem;
}

.login-footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-footer p {
    margin: 0.3rem 0;
}

.login-footer .icp-info {
    font-size: 0.75rem;
}

.login-footer .icp-info a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer .icp-info a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 仪表板布局 */
.dashboard-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    height: 100%;
    background: linear-gradient(180deg, var(--sidebar-bg) 10%, var(--sidebar-dark) 100%);
    color: var(--text-light);
    overflow-y: auto;
    transition: width 0.3s;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    border-radius: 50%;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
}

.sidebar-user .user-info {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-user .user-info p {
    font-weight: 500;
    margin: 0;
}

.sidebar-user .user-info small {
    opacity: 0.8;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: 0.3s;
}

.sidebar-menu li a i:first-child {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.sidebar-menu li a i.fa-chevron-down {
    position: absolute;
    right: 1rem;
    transition: transform 0.3s;
}

.sidebar-menu li.active>a {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #fff;
}

.sidebar-menu li:hover>a {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu li.active>a i.fa-chevron-down,
.sidebar-menu li.menu-has-children.active>a i.fa-chevron-down {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-menu li.active .submenu {
    max-height: 500px;
}

.submenu li a {
    padding-left: 3.5rem;
}

.submenu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 主内容区 */
.main-content {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
}

.main-content.expanded {
    margin-left: 0;
}

/* 顶部导航栏 */
.topbar {
    height: 70px;
    background-color: var(--topbar-bg);
    box-shadow: var(--box-shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 100;
}

.toggle-sidebar {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--grey-color);
    margin-right: 1rem;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    max-width: 400px;
    position: relative;
}

.search-box input {
    border-radius: 30px;
    padding-left: 2.5rem;
    background-color: var(--light-color);
    border: none;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--grey-color);
}

.topbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.notification {
    position: relative;
    margin-right: 1.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--grey-color);
}

.notification .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.user-dropdown i {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--grey-color);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    box-shadow: var(--box-shadow);
    border-radius: 0.25rem;
    min-width: 160px;
    display: none;
    z-index: 1000;
}

.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--card-border);
}

.user-dropdown-menu a:last-child {
    border-bottom: none;
}

.user-dropdown-menu a:hover {
    background-color: var(--light-color);
}

.user-dropdown-menu a i {
    margin-right: 0.5rem;
    color: var(--grey-color);
}

/* 页面内容区 */
.page-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: white;
    border-radius: 0.25rem;
    box-shadow: var(--box-shadow-sm);
}

.breadcrumb i {
    margin-right: 0.5rem;
    color: var(--grey-color);
}

.content-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.page-section {
    display: none;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.page-section.active {
    display: block;
}

.page-section.active {
    display: block;
}

/* 仪表板卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: var(--box-shadow-sm);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-right: 1rem;
}

.card-icon.blue {
    background: linear-gradient(120deg, #4e73df 0%, #224abe 100%);
}

.card-icon.green {
    background: linear-gradient(120deg, #1cc88a 0%, #169e6c 100%);
}

.card-icon.orange {
    background: linear-gradient(120deg, #f6c23e 0%, #dda20a 100%);
}

.card-icon.purple {
    background: linear-gradient(120deg, #9c27b0 0%, #7b1fa2 100%);
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.card-info p {
    color: var(--text-muted);
    margin: 0;
}

/* 图表卡片 */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
}

.chart-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.chart-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.chart-body {
    padding: 1.5rem;
}

.chart-placeholder {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-color);
    border-radius: 0.25rem;
    overflow: hidden;
}

/* 表格卡片 */
.dashboard-tables {
    margin-bottom: 1.5rem;
}

.table-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

.table-header .view-all {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.table-header .view-all i {
    margin-left: 0.25rem;
}

.table-body {
    padding: 0 1.5rem 1.5rem;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}

.data-table th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--grey-color);
}

.data-table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

.data-table .text-center {
    text-align: center;
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10vh auto;
    border-radius: 0.5rem;
    box-shadow: var(--box-shadow);
    max-width: 500px;
}

/* 只有当模态框显示时才播放动画 */
.modal[style*="display: block"] .modal-content {
    animation: modal-in 0.3s;
}

@keyframes modal-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-header .close {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* 通知样式 */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease-in-out;
    z-index: 9999;
    min-width: 300px;
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-toast.error {
    border-left: 4px solid #dc3545;
}

.notification-toast.success {
    border-left: 4px solid #28a745;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 20px;
}

.notification-toast.error i {
    color: #dc3545;
}

.notification-toast.success i {
    color: #28a745;
}

.notification-content span {
    color: #333;
    font-size: 14px;
}

/* 响应式布局 */
@media (max-width: 992px) {
    .sidebar {
        width: 0;
    }

    .sidebar.collapsed {
        width: 250px;
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .topbar {
        padding: 0 1rem;
    }

    .page-content {
        padding: 1rem;
    }

    .search-box {
        display: none;
    }
}

/* 运输记录表单区域样式 */
.transport-input-area {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.transport-form {
    width: 100%;
}

.transport-form .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -5px;
    margin-left: -5px;
    align-items: flex-end;
}

.transport-form .form-group {
    padding: 0 5px;
    margin-bottom: 0;
}

.transport-form label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 4px;
}

.transport-form .form-control {
    height: 38px;
    padding: 6px 12px;
    font-size: 0.95rem;
}

.plate-number-display {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    padding-left: 2px;
}

.transport-form .btn-block {
    height: 38px;
    margin-top: 0;
}

/* 调整搜索过滤器样式 */
.search-filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-group {
    display: flex;
    gap: 10px;
    flex: 1;
}

.date-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group {
    min-width: 120px;
}

/* 表格容器样式优化 */
.table-container {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 分页样式优化 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px 0;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination button {
    min-width: 40px;
    height: 32px;
    padding: 0 10px;
    font-size: 0.9rem;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 5px;
    color: #666;
}

/* 支付进度条样式 */
.progress-bar {
    position: relative;
    width: 100px;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}