/**
 * 华新CRM 自定义样式
 */

/* ========== 登录页 ========== */
.hx-login-wrap {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hx-login-box {
    width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
    padding: 50px 40px 40px;
    text-align: center;
}
.hx-login-box .hx-logo {
    font-size: 28px;
    font-weight: 700;
    color: #8b0000;
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.hx-login-box .hx-subtitle {
    font-size: 14px;
    color: #999;
    margin-bottom: 36px;
}
.hx-login-box .layui-form-item {
    margin-bottom: 20px;
}
.hx-login-box .layui-input {
    height: 44px;
    border-radius: 6px;
    font-size: 14px;
    padding: 0 15px;
}
.hx-login-box .layui-btn {
    width: 100%;
    height: 44px;
    border-radius: 6px;
    font-size: 16px;
    background: #8b0000;
    border: none;
    letter-spacing: 2px;
}
.hx-login-box .layui-btn:hover {
    background: #a00000;
}

/* ========== 主框架 ========== */
.hx-layout {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
}
.hx-header {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.hx-header .hx-logo-sm {
    font-size: 20px;
    font-weight: 700;
    color: #8b0000;
    margin-right: 30px;
    white-space: nowrap;
}
.hx-header .hx-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.hx-header .hx-user-name {
    color: #333;
    font-size: 14px;
}
.hx-header .hx-user-name i {
    margin-right: 4px;
}
.hx-header .hx-logout {
    color: #999;
    cursor: pointer;
    font-size: 14px;
}
.hx-header .hx-logout:hover {
    color: #8b0000;
}

.hx-side {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #20222A;
    overflow-y: auto;
    z-index: 999;
    transition: width 0.3s;
}
.hx-side .layui-nav {
    background: none;
}
.hx-side .layui-nav .layui-nav-item a {
    color: #ccc;
    padding: 0 20px;
    height: 46px;
    line-height: 46px;
    font-size: 14px;
}
.hx-side .layui-nav .layui-nav-item a:hover,
.hx-side .layui-nav .layui-this a {
    color: #fff;
    background: rgba(139, 0, 0, 0.6);
}
.hx-side .layui-nav .layui-nav-item a i {
    margin-right: 8px;
}
.hx-side .layui-nav-tree .layui-nav-bar {
    background: #8b0000;
    width: 3px !important;
}
.hx-side .layui-nav .layui-nav-child a {
    padding-left: 44px;
    color: #aaa;
}
.hx-side .layui-nav .layui-nav-child a:hover {
    color: #fff;
    background: rgba(139, 0, 0, 0.4);
}

.hx-body {
    position: fixed;
    top: 60px;
    left: 220px;
    right: 0;
    bottom: 0;
    overflow: hidden;
    transition: left 0.3s;
}
.hx-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #f2f2f2;
}

/* ========== 内容页面通用 ========== */
.hx-page {
    padding: 16px;
    background: #f2f2f2;
    min-height: 100%;
    box-sizing: border-box;
}
.hx-page-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6e6e6;
}
.hx-page-title span {
    font-size: 13px;
    color: #999;
    font-weight: normal;
    margin-left: 10px;
}

/* ========== 统计卡片 ========== */
.hx-stat-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.hx-stat-card {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border-radius: 8px;
    padding: 24px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}
.hx-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: #8b0000;
    border-radius: 4px 0 0 4px;
}
.hx-stat-card .hx-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 8px;
}
.hx-stat-card .hx-stat-label {
    font-size: 13px;
    color: #999;
}
.hx-stat-card .hx-stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: #f0f0f0;
}
.hx-stat-card:nth-child(1)::before { background: #8b0000; }
.hx-stat-card:nth-child(2)::before { background: #1e9fff; }
.hx-stat-card:nth-child(3)::before { background: #16baaa; }
.hx-stat-card:nth-child(4)::before { background: #ffb800; }

/* ========== 卡片容器 ========== */
.hx-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.hx-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* ========== 搜索工具栏 ========== */
.hx-toolbar {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.hx-toolbar .layui-input {
    height: 36px;
    border-radius: 4px;
}
.hx-toolbar .layui-btn {
    height: 36px;
    border-radius: 4px;
}

/* ========== 表格优化 ========== */
.hx-page .layui-table-view {
    border-radius: 8px;
    overflow: hidden;
}
.hx-page .layui-table th {
    background: #fafafa;
    color: #333;
    font-weight: 600;
}

/* ========== 标签 ========== */
.hx-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 12px;
    color: #fff;
}

/* ========== 操作按钮组 ========== */
.hx-btn-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.hx-btn-group .layui-btn-xs {
    height: 26px;
    line-height: 26px;
    padding: 0 8px;
    font-size: 12px;
}

/* ========== 客户详情 ========== */
.hx-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.hx-detail-item {
    display: flex;
    align-items: baseline;
    font-size: 14px;
}
.hx-detail-item .hx-label {
    color: #999;
    min-width: 80px;
    flex-shrink: 0;
}
.hx-detail-item .hx-value {
    color: #333;
    font-weight: 500;
}

/* ========== 跟进记录 ========== */
.hx-follow-item {
    border-left: 3px solid #8b0000;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #fafafa;
    border-radius: 0 6px 6px 0;
}
.hx-follow-item .hx-follow-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}
.hx-follow-item .hx-follow-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

/* ========== 录音播放器 ========== */
.hx-audio-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hx-audio-wrap audio {
    height: 32px;
}

/* ========== 通话统计图表 ========== */
.hx-chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 10px 0;
}
.hx-chart-bar .hx-bar {
    flex: 1;
    background: linear-gradient(180deg, #8b0000, #c44);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
}
.hx-chart-bar .hx-bar:hover {
    opacity: 0.8;
}
.hx-chart-bar .hx-bar-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}
.hx-chart-bar .hx-bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .hx-side {
        width: 0;
        overflow: hidden;
    }
    .hx-body {
        left: 0;
    }
    .hx-stat-cards {
        flex-direction: column;
    }
    .hx-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}
