:root {
    /* 科技蓝配色方案 */
    --primary-color: #409EFF; /* 鲜亮的科技蓝 */
    --primary-hover: #4096ff;
    --primary-active: #0958d9;
    --bg-color: #f0f2f5;
    --text-color: #2c3e50;
    --heading-color: #1a1a1a;
    --card-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.08);
    --border-radius: 6px;
    --sidebar-bg: #f8f9fa; /* 浅灰侧边栏 */
    --sidebar-text: #333333;
    --header-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #d9d9d9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

/* --- Buttons --- */
.layui-btn, .pear-btn {
    border-radius: var(--border-radius);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    border: 1px solid transparent;
    font-weight: 500;
}

.pear-btn {
    border: 1px solid #d9d9d9;
}

.layui-btn:hover, .pear-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.25);
}

.pear-btn-success, .layui-btn-normal, .layui-btn-primary:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.layui-btn-primary {
    border-color: #d9d9d9;
    color: rgba(0, 0, 0, 0.88);
    background: #fff;
}

/* --- Inputs --- */
.layui-input, .layui-textarea, .layui-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--input-border);
    transition: all 0.3s;
    height: 38px;
    color: rgba(0, 0, 0, 0.88);
}

.layui-input:hover, .layui-textarea:hover {
    border-color: var(--primary-hover);
}

.layui-input:focus, .layui-textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2) !important;
}

/* --- Cards --- */
.layui-card {
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    border: none;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s;
}

.layui-card:hover {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.12);
}

.layui-card-header {
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    color: var(--heading-color);
    background-color: #fff;
    border-radius: 8px 8px 0 0;
    font-size: 16px;
    padding: 0 24px;
}

.layui-card-body {
    padding: 24px;
}

/* --- Layout --- */
.layui-layout-admin .layui-header {
    background-color: var(--header-bg) !important;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    border-bottom: none;
    z-index: 1000;
}

.layui-layout-admin .layui-logo {
    background-color: var(--sidebar-bg) !important;
    color: var(--primary-color) !important;
    box-shadow: none !important;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
}

/* Sidebar adjustments */
.layui-side {
    background-color: var(--sidebar-bg) !important;
    box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
    border-right: 1px solid #f0f0f0;
}

.layui-logo {
    background-color: var(--sidebar-bg) !important;
    color: #333 !important;
    box-shadow: none !important;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Menu Container */
.pear-nav-tree {
    background-color: transparent !important;
    padding: 10px;
    width: 100% !important;
    box-sizing: border-box;
}

/* Menu Items */
.pear-nav-tree .layui-nav-item {
    margin-bottom: 2px;
}

.layui-nav-tree .layui-nav-item {
    width: 90%;
}

.pear-nav-tree .layui-nav-item > a {
    color: var(--sidebar-text) !important;
    border-radius: 8px;
    height: 40px !important;
    line-height: 40px !important;
    padding-left: 16px !important;
    transition: all 0.3s;
}

/* Hover State */
.pear-nav-tree .layui-nav-item > a:hover {
    background-color: #f5f7fa !important;
    color: var(--primary-color) !important;
}

/* Selected State (Parent Item) */
.pear-nav-tree .layui-nav-item.layui-this > a {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}

/* Submenu */
.pear-nav-tree .layui-nav-child {
    background-color: rgba(0, 0, 0, 0.02) !important; /* 增加淡淡的背景色区分层级 */
    padding: 0 !important;
}

.pear-nav-tree .layui-nav-child dd {
    margin-bottom: 1px;
    border-radius: 12px;
}

/* 二级菜单 */
.pear-nav-tree .layui-nav-child dd a {
    padding-left: 48px !important;
    color: #606266 !important;
    border-radius: 8px;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 14px;
}

/* 三级菜单 - 增加缩进 */
.pear-nav-tree .layui-nav-child .layui-nav-child {
    background-color: rgba(0, 0, 0, 0.03) !important; /* 三级菜单背景稍深 */
}

.pear-nav-tree .layui-nav-child .layui-nav-child dd a {
    padding-left: 68px !important;
    font-size: 13px;
}

.pear-nav-tree .layui-nav-child dd a:hover {
    background-color: #f5f7fa !important;
    color: var(--primary-color) !important;
    border-radius: 12px;
}

/* Selected Submenu Item */
.pear-nav-tree .layui-nav-child dd.layui-this a {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
    font-weight: 500;
    border-radius: 12px;
}

/* Icons */
.pear-nav-tree .layui-nav-item a i {
    font-size: 16px;
    margin-right: 10px;
}

/* Header Menu Items */
.layui-layout-left .layui-nav-item > a,
.layui-layout-right .layui-nav-item > a {
    color: rgba(0, 0, 0, 0.65) !important;
}

.layui-layout-left .layui-nav-item > a:hover,
.layui-layout-right .layui-nav-item > a:hover {
    color: var(--primary-color) !important;
    background-color: rgba(0, 0, 0, 0.025);
}

/* Tables */
.layui-table {
    color: rgba(0, 0, 0, 0.65);
}

.layui-table th {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

/* --- Layer (Popups) --- */
.layui-layer {
    box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) !important;
    border-radius: 8px !important;
    border: none !important;
}

.layui-layer-title {
    border-radius: 8px 8px 0 0 !important;
    background-color: #fff !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
}

.layui-layer-btn .layui-layer-btn0 {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff;
}

.layui-table-cell {

    white-space: nowrap;
}

/* 页面特定样式优化 */
.layui-card-body {
    padding: 10px 15px;
}

.layui-form-item {
    margin-bottom: 0;
}

/* 表格头部背景 */
.layui-table-header th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

/* 状态标签优化 */
.status-tag {
    display: inline-block;
    padding: 0 8px;
    height: 22px;
    line-height: 20px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid;
    box-sizing: border-box;
    white-space: nowrap;
}

.status-info {
    background-color: #f4f4f5;
    border-color: #e9e9eb;
    color: #909399;
}

/* 未支付 - 橙色 */
.status-wait {
    background-color: #fdf6ec;
    border-color: #faecd8;
    color: #e6a23c;
}

/* 未支付 - 橙色 */
.status-success {
    background-color: #f0f9eb;
    border-color: #e1f3d8;
    color: #67C23A;
}

.status-fail {
    background-color: #fef0f0;
    border-color: #fde2e2;
    color: #f56c6c;
}
/* 已支付 - 绿色 */
.status-refund {
    background-color: #fef0f0;
    border-color: #fde2e2;
    color: #f56c6c;
}

.status-primary{
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

/* 已退款 - 红色 */

.deduction-no {
    background-color: #f4f4f5;
    border-color: #e9e9eb;
    color: #909399;
}

/* 未扣量 - 灰色 */
.deduction-yes {
    background-color: #ecf5ff;
    border-color: #d9ecff;
    color: #409EFF;
}

/* 已扣量 - 蓝色 */

/* 价格样式 */
.price-text {
    color: #ff4d4f;
    font-weight: bold;
    font-size: 14px;
}

/* 订单信息样式 */
.order-info-label {
    color: #909399;
    font-size: 12px;
    margin-right: 4px;
}

.order-info-value {
    color: #606266;
    font-size: 12px;
}

.order-info-row {
    line-height: 1.4;
    margin-bottom: 2px;
}

/* 表格工具栏样式优化 */
.layui-table-tool {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 15px;
    min-height: 50px;
}

.layui-table-tool-temp {
    padding-right: 0;
}

/* 工具栏按钮样式 */
.layui-table-tool .pear-btn {
    margin-right: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
    transition: all 0.3s;
}

.layui-table-tool .pear-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 批量回传按钮 */
.layui-table-tool [lay-event="batchDeduction"] {
    background-color: #fff;
    border: 1px solid #dcdfe6;
    color: #606266;
}

.layui-table-tool [lay-event="batchDeduction"]:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

/* 清理按钮 */
.layui-table-tool [lay-event="clearUnpaid"] {
    background-color: #ff4d4f;
    color: #fff;
    border: none;
}

.layui-table-tool [lay-event="clearUnpaid"]:hover {
    color: #cc5e42ff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}