@charset "utf-8";

:root {
    --primary-color: #409EFF;
    --success-color: #67C23A;
    --warning-color: #E6A23C;
    --danger-color: #F56C6C;
    --info-color: #909399;
    --text-primary: #303133;
    --text-regular: #606266;
    --text-secondary: #909399;
    --border-color: #DCDFE6;
    --bg-color: #F5F7FA;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 64px;
    --header-height: 60px;
}

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

html {
    font-size: 16px;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-color);
    line-height: 1.6;
}

.app-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.main-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #304156;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1001;
    transition: all 0.3s;
    overflow: hidden;
}

.main-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.main-sidebar .logo-container {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    /*background: #2b3a4a;*/
    border-bottom: 1px solid #3a4a5a;
}

.main-sidebar .logo-container .logo-text {
    /*color: #fff;*/
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.main-sidebar.collapsed .logo-container .logo-text {
    display: none;
}

.sidebar-menu {
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.menu-item:hover {
    background: #263445;
    color: #fff;
}

.menu-item.active {
    background: #1f8efa !important;
    color: #fff;
    border-left-color: var(--primary-color);
}

.menu-item .menu-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-item .menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-container {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
    display: flex;
    flex-direction: column;
}

.main-container.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

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

.top-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-header .toggle-sidebar {
    font-size: 20px;
    cursor: pointer;
    color: var(--text-regular);
    transition: color 0.3s;
}

.top-header .toggle-sidebar:hover {
    color: var(--primary-color);
}

.top-header .page-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.top-header .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.top-header .user-info:hover {
    background: var(--bg-color);
}

.top-header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.top-header .user-name {
    font-size: 14px;
    color: var(--text-regular);
}

.top-header .mobile-nav-dropdown {
    display: none;
}

@media screen and (min-width: 993px) {
    .top-header .mobile-nav-dropdown {
        display: none;
    }
    
    .top-header .desktop-user-dropdown {
        display: block;
    }
}

.top-header .mobile-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-color);
    cursor: pointer;
    transition: background 0.3s;
}

.top-header .mobile-nav-button:hover {
    background: #e6e8eb;
}

.top-header .mobile-nav-button i {
    font-size: 20px;
    color: var(--text-regular);
}

.page-main {
    flex: 1;
    padding: 20px;
    background: var(--bg-color);
    overflow-y: auto;
}

.content-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.content-card .card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-card .card-header .card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.content-card .card-body {
    padding: 20px;
}

.breadcrumb-container {
    margin-bottom: 20px;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: #c0c4cc;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color 0.3s;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.data-table {
    width: 100%;
    background: #fff;
    border-radius: 4px;
}

.data-table th {
    background: #f5f7fa;
    color: #606266;
    font-weight: 600;
    padding: 12px 0;
}

.data-table td {
    padding: 12px 0;
    border-bottom: 1px solid #ebeef5;
}

.data-table tr:hover {
    background: #f5f7fa;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-box {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.blue {
    background: #e6f7ff;
    color: #1890ff;
}

.stat-icon.green {
    background: #e6fffb;
    color: #52c41a;
}

.stat-icon.orange {
    background: #fff7e6;
    color: #fa8c16;
}

.stat-icon.red {
    background: #fff1f0;
    color: #ff4d4f;
}

.stat-content .stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-content .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-box {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ebeef5;
}

.form-row {
    margin-bottom: 20px;
}

.form-label {
    font-size: 14px;
    color: var(--text-regular);
    margin-bottom: 8px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #66b1ff;
}

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

.btn-success:hover {
    background: #85ce61;
}

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

.btn-danger:hover {
    background: #f78989;
}

.btn-default {
    background: #fff;
    color: var(--text-regular);
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.mobile-sidebar-toggle {
    display: none;
}

@media screen and (max-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 992px) {
    .app-wrapper {
        display: block;
    }

    .main-sidebar,
    .main-sidebar.collapsed {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .main-container {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .main-container.sidebar-collapsed {
        margin-left: 0 !important;
    }

    .mobile-sidebar-toggle {
        display: none !important;
    }

    .mobile-overlay {
        display: none !important;
    }

    .top-header .user-name {
        display: none;
    }

    .top-header .mobile-nav-dropdown {
        display: block !important;
    }

    .top-header .desktop-user-dropdown {
        display: none !important;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tab-content-wrapper {
        height: calc(100vh - 180px);
        min-height: 300px;
    }

    .tab-content-wrapper iframe {
        width: 100%;
        height: 100%;
        min-height: 300px;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --header-height: 50px;
    }

    html {
        font-size: 14px;
    }

    .top-header {
        padding: 0 15px;
    }

    .top-header .page-title {
        font-size: 14px;
    }

    .page-main {
        padding: 15px;
    }

    .content-card .card-header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .content-card .card-body {
        padding: 15px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-box {
        padding: 15px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .stat-content .stat-num {
        font-size: 20px;
    }

    .form-box {
        padding: 20px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 5px;
    }

    .tab-content-wrapper {
        height: calc(100vh - 160px);
        min-height: 250px;
    }

    .tab-content-wrapper iframe {
        width: 100%;
        height: 100%;
        min-height: 250px;
    }
}

@media screen and (max-width: 576px) {
    .top-header {
        padding: 0 10px;
    }

    .top-header .header-left {
        gap: 10px;
    }

    .page-main {
        padding: 10px;
    }

    .breadcrumb-container {
        margin-bottom: 15px;
    }

    .tab-content-wrapper {
        height: calc(100vh - 150px);
        min-height: 200px;
    }

    .tab-content-wrapper iframe {
        width: 100%;
        height: 100%;
        min-height: 200px;
    }
}

@media screen and (min-width: 1400px) {
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (min-width: 1920px) {
    html {
        font-size: 18px;
    }

    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

.hover-scale {
    transition: transform 0.3s;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.shadow-hover {
    transition: box-shadow 0.3s;
}

.shadow-hover:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

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

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-muted {
    color: var(--text-secondary);
}
