/* ====================================================================
   长海科技 ERP 管理后台 — 主样式表
   风格参照 https://www.yycfk.com:8380/  LayUI 蓝主题
   - 主蓝：    #4276B7（yycfk common 蓝）
   - 副蓝：    #4096d1
   - 内容背景：#f2f2f2
   - 文字：    #666
   - 边框：    #f6f6f6 / #d6d6d6
   ==================================================================== */

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial,
                 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;
    background-color: #f2f2f2;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #4276B7; }

code {
    background: #f6f6f6;
    padding: 1px 6px;
    border-radius: 2px;
    color: #4276B7;
    font-size: 12px;
    border: 1px solid #e6e6e6;
}

/* ====================================================================
   整体布局
   ==================================================================== */
.layout { min-height: 100vh; }

/* ====================================================================
   顶部 header（yycfk 真实色 #4276B7）
   ==================================================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #4276B7;
    color: #ffffff;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.app-header .trigger {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #ffffff;
    transition: background 0.2s;
}
.app-header .trigger:hover { background: rgba(0, 0, 0, 0.05); }

.app-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 20px;
    height: 50px;
}
.app-header .brand-logo {
    height: 14px;
    width: auto;
    background: transparent;
    border-radius: 2px;
    object-fit: contain;
}
.app-header .brand-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.app-header .header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    height: 50px;
}
.app-header .header-icon-btn {
    width: 38px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 16px;
    transition: background 0.2s;
}
.app-header .header-icon-btn:hover { background: rgba(0, 0, 0, 0.05); }
.app-header .header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 50px;
    cursor: pointer;
    transition: background 0.2s;
    color: #ffffff;
}
.app-header .header-user:hover { background: rgba(0, 0, 0, 0.05); color: #ffffff; }
.app-header .header-user .avatar {
    width: 26px;
    height: 26px;
    background: #ffffff;
    color: #4276B7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}
.app-header .header-user .username { color: #ffffff; font-size: 14px; }
.app-header .header-user .caret { font-size: 10px; opacity: 0.85; }

.header-logout {
    color: #ffffff;
    background: transparent;
    border: none;
    padding: 0 14px;
    height: 50px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.header-logout:hover { background: rgba(0, 0, 0, 0.05); }

/* ====================================================================
   左侧 sidebar（yycfk 真实色 #353F54）
   - 顶部首页区：#262D3D（更深）
   - 主菜单区：  #353F54
   - 子菜单展开：#2C3346（略深于主）
   - 激活态：    #4276B7
   ==================================================================== */
.app-sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #353F54;
    color: #a9b2c6;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease;
    z-index: 99;
}
.app-sidebar.collapsed { width: 0; }

.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.menu { list-style: none; padding: 0; margin: 0; }
.menu-item { border: 0; }

/* 顶部"首页"独立深色块（放在 .menu 第一个） */
.menu-item.menu-item-top > a {
    background: #262D3D;
    color: #ffffff;
    border-left-color: transparent;
    margin-bottom: 4px;
}
.menu-item.menu-item-top > a:hover {
    background: #2D3548;
    color: #ffffff;
}

.menu-item > a {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 44px;
    color: #a9b2c6;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.menu-item > a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.menu-item.active > a {
    color: #ffffff;
    background: #4276B7;
    border-left-color: #ffffff;
}

.menu-icon {
    width: 22px;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.95;
}
.menu-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.submenu-toggle {
    font-size: 10px;
    transition: transform 0.2s;
    margin-left: auto;
    opacity: 0.7;
}
.menu-item.active .submenu-toggle { transform: rotate(90deg); opacity: 1; }

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #2C3346;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.menu-item.active .submenu { max-height: 500px; }

.submenu-item > a {
    display: flex !important;
    align-items: center;
    height: 40px;
    padding: 0 20px 0 50px !important;
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent !important;
    background: transparent !important;
}
.submenu-item > a:hover { color: #ffffff !important; background: rgba(255,255,255,0.05) !important; }
.submenu-item.active > a {
    color: #ffffff !important;
    background: #4276B7 !important;
    border-left-color: #ffffff !important;
}

/* ====================================================================
   主内容区
   ==================================================================== */
.app-main {
    margin-left: 220px;
    margin-top: 50px;
    padding: 0;
    transition: margin-left 0.2s ease;
    min-height: calc(100vh - 50px);
    background: #f2f2f2;
}
.app-sidebar.collapsed ~ .app-main { margin-left: 0; }

/* 面包屑 */
.breadcrumb-bar {
    background: #ffffff;
    padding: 0 20px;
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #f6f6f6;
    color: #666;
    font-size: 14px;
}
.breadcrumb-bar a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb-bar a:hover { color: #4276B7; }
.breadcrumb-bar .sep { margin: 0 8px; color: #d6d6d6; }
.breadcrumb-bar .current { color: #333; }

/* 主体容器 */
.body-wrap {
    padding: 16px;
}

/* ---------- 欢迎条 ---------- */
.welcome-bar {
    background: #ffffff;
    padding: 14px 20px;
    margin-bottom: 16px;
    border-radius: 2px;
    border: 1px solid #f6f6f6;
    color: #666;
    font-size: 14px;
}
.welcome-bar strong { color: #333; }
.welcome-bar .ant-tag {
    display: inline-block;
    background: #e8f4ff;
    color: #4276B7;
    border: 1px solid #b9e2ff;
    padding: 1px 8px;
    border-radius: 2px;
    font-size: 12px;
    margin-left: 4px;
}

/* ---------- 内容卡片 ---------- */
.content-card {
    background: #ffffff;
    border-radius: 2px;
    border: 1px solid #f6f6f6;
    padding: 20px;
    margin-bottom: 16px;
}
.content-card-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    padding-bottom: 14px;
    border-bottom: 1px solid #f6f6f6;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.content-card-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #4276B7;
    border-radius: 1px;
}

/* ---------- 统计卡片（首页 dashboard）---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.stat-card {
    background: #ffffff;
    border-radius: 2px;
    border: 1px solid #f6f6f6;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}
.stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: #4276B7; }
.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
}
.stat-card .stat-icon.blue { background: #4276B7; }
.stat-card .stat-icon.orange { background: #FF7800; }
.stat-card .stat-icon.green { background: #5FB878; }
.stat-card .stat-icon.red { background: #FF5722; }
.stat-card .stat-icon.purple { background: #8A2BE2; }
.stat-card .stat-value { font-size: 24px; font-weight: 600; color: #333; line-height: 1.2; }
.stat-card .stat-label { font-size: 13px; color: #999; margin-top: 4px; }

/* ====================================================================
   按钮（LayUI 风格）
   ==================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #d6d6d6;
    border-radius: 2px;
    background: #ffffff;
    color: #666;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.btn:hover { color: #4276B7; border-color: #4276B7; }
.btn:active { color: #4276B7; }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-primary {
    background: #4276B7;
    border-color: #4276B7;
    color: #ffffff;
}
.btn-primary:hover { background: #4276B7; border-color: #4276B7; color: #ffffff; opacity: 0.9; }

.btn-normal {
    background: #ffffff;
    border-color: #4276B7;
    color: #4276B7;
}
.btn-normal:hover { background: #4276B7; color: #ffffff; }

.btn-warm {
    background: #FFB800;
    border-color: #FFB800;
    color: #ffffff;
}
.btn-warm:hover { background: #FFB800; border-color: #FFB800; color: #ffffff; opacity: 0.9; }

.btn-danger {
    color: #FF5722;
    border-color: #FF5722;
    background: #ffffff;
}
.btn-danger:hover { background: #FF5722; color: #ffffff; }

.btn-sm {
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1;
}

.btn-lg {
    height: 38px;
    padding: 0 18px;
    font-size: 16px;
}

/* ====================================================================
   表格
   ==================================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th, .data-table td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid #f6f6f6;
}
.data-table th {
    background: #fafafa;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}
.data-table tr:hover td { background: #f8f8f8; }
.data-table .empty-row {
    text-align: center;
    color: #999;
    padding: 40px;
}

.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ====================================================================
   搜索栏
   ==================================================================== */
.search-bar {
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 2px;
    border: 1px solid #f6f6f6;
    margin-bottom: 16px;
}
.search-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.search-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.search-item label {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="search"], select, textarea {
    padding: 0 10px;
    border: 1px solid #d6d6d6;
    border-radius: 2px;
    font-size: 14px;
    background-color: #ffffff;
    color: #333;
    transition: border-color 0.2s;
    font-family: inherit;
    height: 32px;
    line-height: 32px;
}
textarea { height: auto; min-height: 80px; padding: 8px 10px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4276B7;
}
input:hover, select:hover, textarea:hover { border-color: #4276B7; }

/* ====================================================================
   分页
   ==================================================================== */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #d6d6d6;
    border-radius: 2px;
    background: #ffffff;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.pagination a:hover {
    color: #4276B7;
    border-color: #4276B7;
}
.pagination .active {
    color: #ffffff;
    background: #4276B7;
    border-color: #4276B7;
}
.pagination .disabled {
    color: #c2c2c2;
    background: #f6f6f6;
    border-color: #d6d6d6;
    cursor: not-allowed;
}
.pagination .ellipsis {
    border: none;
    background: transparent;
    color: #999;
}
.page-meta-inline {
    margin-left: 12px;
    font-size: 13px;
    color: #999;
    border: none !important;
    background: transparent !important;
    height: auto !important;
    padding: 0 !important;
}

/* ====================================================================
   Tag 标签
   ==================================================================== */
.ant-tag {
    display: inline-block;
    padding: 0 8px;
    font-size: 12px;
    line-height: 20px;
    border-radius: 2px;
    border: 1px solid;
    background: #fafafa;
    color: #666;
}
.tag-admin { background: #FFF7E6; color: #FF7800; border-color: #FFD9A8; }
.tag-user { background: #E8F4FF; color: #4276B7; border-color: #B9E2FF; }
.tag-active { background: #F0F9E8; color: #5FB878; border-color: #C5E1A5; }
.tag-disabled { background: #f6f6f6; color: #999; border-color: #d6d6d6; }
.tag-source { background: #F4F0FF; color: #8A2BE2; border-color: #D9C7FF; }

/* ====================================================================
   Tab 切换（如"车辆信息/异常车辆"）
   ==================================================================== */
.layui-tab {
    margin-bottom: 0;
    background: #ffffff;
}
.layui-tab-title {
    list-style: none;
    display: flex;
    border-bottom: 2px solid #4276B7;
    padding: 0;
    margin: 0;
}
.layui-tab-title li {
    padding: 8px 18px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: all 0.2s;
}
.layui-tab-title li.layui-this {
    background: #4276B7;
    color: #ffffff;
}
.layui-tab-content { padding: 16px 0; }
.layui-tab-item { display: none; }
.layui-tab-item.layui-show { display: block; }

/* ====================================================================
   表单卡片
   ==================================================================== */
.form-card {
    max-width: 720px;
    background: #ffffff;
    padding: 28px;
    border-radius: 2px;
    border: 1px solid #f6f6f6;
}
.form-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.form-row > label {
    text-align: right;
    font-size: 14px;
    color: #666;
}
.form-row > label .required { color: #FF5722; margin-right: 4px; }
.form-row > input,
.form-row > select {
    width: 100%;
    max-width: 320px;
}
.form-hint {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}
.switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.switch-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}
.form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f6f6f6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ====================================================================
   提示信息
   ==================================================================== */
.alert {
    padding: 10px 16px;
    border-radius: 2px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-success {
    background: #F0F9E8;
    color: #5FB878;
    border-color: #C5E1A5;
}
.alert-error {
    background: #FFEBE0;
    color: #FF5722;
    border-color: #FFCBB0;
}
.alert-info {
    background: #E8F4FF;
    color: #4276B7;
    border-color: #B9E2FF;
}

/* ====================================================================
   首页 grid
   ==================================================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.info-card {
    background: #ffffff;
    border-radius: 2px;
    border: 1px solid #f6f6f6;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.info-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.info-card-title {
    padding: 12px 20px;
    border-bottom: 1px solid #f6f6f6;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    background: #fafafa;
}
.info-card-body { padding: 18px 20px; font-size: 14px; color: #666; }
.info-card-body ul { list-style: none; padding: 0; }
.info-card-body ul li {
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.info-card-body ul li:last-child { border-bottom: none; }
.info-card-body a { color: #4276B7; text-decoration: none; }
.info-card-body a:hover { color: #4276B7; text-decoration: underline; }
.muted { color: #999; }

.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th, .kv-table td { padding: 6px 0; font-size: 14px; border: none; }
.kv-table th { width: 90px; color: #999; font-weight: 400; text-align: left; }
.kv-table td { color: #333; }

details summary { cursor: pointer; color: #4276B7; font-size: 13px; padding: 6px 0; }
details summary:hover { color: #4276B7; text-decoration: underline; }
.perm-list {
    list-style: none;
    padding: 8px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px;
}
.perm-list li {
    padding: 4px 10px;
    background: #f0f9ff;
    color: #4276B7;
    border-radius: 2px;
    font-size: 12px;
    border: 1px solid #d6ecff;
}

/* ====================================================================
   错误页
   ==================================================================== */
.error-page {
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 2px;
    border: 1px solid #f6f6f6;
}
.error-page h1 {
    font-size: 72px;
    color: #4276B7;
    margin-bottom: 16px;
    font-weight: 300;
}
.error-page p { color: #999; margin-bottom: 24px; }
.error-detail {
    background: #FFEBE0;
    color: #FF5722;
    padding: 12px;
    border-radius: 2px;
    text-align: left;
    margin-bottom: 18px;
    font-size: 12px;
    border: 1px solid #FFCBB0;
    overflow-x: auto;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ====================================================================
   Page meta (toolbar above tables)
   ==================================================================== */
.page-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: #666;
    font-size: 14px;
}
.page-meta strong { color: #4276B7; font-size: 16px; margin: 0 3px; }

/* ====================================================================
   登录页（蓝主题）
   ==================================================================== */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #4276B7;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    padding: 40px 36px 32px;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header .logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: transparent;
    border-radius: 4px;
    object-fit: contain;
    display: block;
}
.login-header h2 {
    color: #333;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 6px;
}
.login-header .subtitle { color: #999; font-size: 13px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #666;
    font-size: 14px;
}
.form-group input {
    width: 100%;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid #d6d6d6;
    border-radius: 2px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: #4276B7;
}

/* 密码输入框 + 显示/隐藏切换按钮 */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 38px; }
.toggle-pwd {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #999;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    border-radius: 2px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.toggle-pwd:hover { color: #4276B7; background: #f6f6f6; }
.toggle-pwd:focus { outline: none; color: #4276B7; }
.toggle-pwd:active { background: #ebeef5; }

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    font-size: 13px;
    color: #666;
}
.remember-me input { width: auto; height: auto; cursor: pointer; margin: 0; }

.btn-login {
    width: 100%;
    height: 38px;
    background: #4276B7;
    color: #ffffff;
    border: 1px solid #4276B7;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-login:hover { opacity: 0.92; }

.login-tip {
    text-align: center;
    margin-top: 22px;
    color: #999;
    font-size: 12px;
}
.login-tip code {
    background: #f6f6f6;
    padding: 2px 6px;
    border-radius: 2px;
    color: #4276B7;
    border: 1px solid #e6e6e6;
}

/* ====================================================================
   响应式
   ==================================================================== */
@media (max-width: 768px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar:not(.collapsed) { transform: translateX(0); }
    .app-main { margin-left: 0 !important; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .form-row > label { text-align: left; }
}