/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 350px;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 布局 */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 150px;
    background: #2c3e50;
    color: white;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
}
/* 添加到现有CSS文件末尾 */

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 徽章样式 */
/*.badge {*/
/*    display: inline-block;*/
/*    padding: 3px 8px;*/
/*    border-radius: 4px;*/
/*    font-size: 12px;*/
/*    font-weight: 500;*/
/*}*/

/*.badge-success {*/
/*    background: #d4edda;*/
/*    color: #155724;*/
/*    border: 1px solid #c3e6cb;*/
/*}*/

.badge-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/*.badge-danger {*/
/*    background: #f8d7da;*/
/*    color: #721c24;*/
/*    border: 1px solid #f5c6cb;*/
/*}*/

/*.badge-info {*/
/*    background: #d1ecf1;*/
/*    color: #0c5460;*/
/*    border: 1px solid #bee5eb;*/
/*}*/

/*.badge-primary {*/
/*    background: #cce5ff;*/
/*    color: #004085;*/
/*    border: 1px solid #b8daff;*/
/*}*/

/*.badge-secondary {*/
/*    background: #e2e3e5;*/
/*    color: #383d41;*/
/*    border: 1px solid #d6d8db;*/
/*}*/

/* 产品统计区域 */
.product-stats {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-stats h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-sub {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 天数统计区域 */
.daily-stats {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.daily-stats h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

/* 表格小型样式 */
.table-sm {
    font-size: 13px;
}

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

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.nav {
    list-style: none;
    padding: 20px 0;
}

.nav li {
    margin-bottom: 5px;
}

.nav a {
    display: block;
    padding: 10px 15px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background 0.3s;
}

.nav a:hover,
.nav a.active {
    background: #34495e;
}

.main {
    flex: 1;
    background: #f5f5f5;
}

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

.header h2 {
    margin: 0;
    font-size: 20px;
}

.user-info {
    color: #666;
}

.content {
    padding: 20px;
}

/* 卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}

.card-number {
    margin: 0;
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* 表格 */
.table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
}

.table tr:hover {
    background: #f5f5f5;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn:hover {
    background: #f5f5f5;
}

.btn-primary {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

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

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

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

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 300px;
}

/* 分页 */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

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

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 50px auto;
    padding: 15px;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.modal-content h3 {
    padding: 10px;
    margin: 0;
    border-bottom: 1px solid #ddd;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

#userForm {
    padding: 20px;
}

/* 表单 */
.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* 最近数据 */
.recent-data {
    margin-top: 30px;
}

.recent-data h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

/* 警告 */
.alert {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-error {
    background: #fde8e8;
    border: 1px solid #f8b4b4;
    color: #c81e1e;
}

/* 工具类 */
.text-center {
    text-align: center;
}

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

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


/* 表格容器 - 横向滚动 */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 表格基础样式 */
.customer-table {
    width: 100%;
    min-width: 1200px; /* 最小宽度，小于此宽度出现滚动条 */
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed; /* 固定列宽 */
}

/* 表头样式 */
.customer-table th {
    background: #f5f5f5;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 单元格样式 */
.customer-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 列宽定义 */
.customer-table .col-id { width: 60px; }
.customer-table .col-name { width: 80px; }
.customer-table .col-tel { width: 110px; }
.customer-table .col-sfzid { width: 150px; }
.customer-table .col-cpname { width: 120px; }
.customer-table .col-status { width: 80px; }
.customer-table .col-amount { width: 100px; text-align: right; }
.customer-table .col-tjr { width: 80px; }
.customer-table .col-date { width: 130px; }
.customer-table .col-action { width: 90px; text-align: center; }

/* 操作按钮紧凑 */
.customer-table .btn-sm {
    padding: 2px 6px;
    font-size: 12px;
    margin: 0 2px;
}

/* 状态标签 */
.badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
}

.badge-info { background: #e3f2fd; color: #1976d2; }
.badge-success { background: #e8f5e9; color: #388e3c; }
.badge-primary { background: #e8eaf6; color: #3f51b5; }
.badge-danger { background: #ffebee; color: #d32f2f; }
.badge-secondary { background: #f5f5f5; color: #616161; }

/* 金额右对齐 */
.col-amount {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* 响应式：小屏幕优化 */
@media (max-width: 768px) {
    .customer-table {
        font-size: 12px;
    }
    
    .customer-table th,
    .customer-table td {
        padding: 6px 4px;
    }
    
    /* 隐藏次要列 */
    .customer-table .col-tjr,
    .customer-table .col-date {
        display: none;
    }
}


/* 分页容器 */
#pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
    padding: 10px;
}

/* 分页按钮基础样式 */
#pagination .btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

#pagination .btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #999;
}

/* 当前页按钮 */
#pagination .btn-primary.active {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

/* 禁用按钮 */
#pagination .btn:disabled,
#pagination .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* 省略号 */
.pagination-ellipsis {
    padding: 0 8px;
    color: #999;
    font-size: 14px;
}

/* 跳转区域 */
.pagination-jump {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 15px;
    font-size: 13px;
    color: #666;
}

.pagination-jump input {
    width: 50px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}

.pagination-jump input:focus {
    outline: none;
    border-color: #1890ff;
}

/* 响应式：小屏幕简化 */
@media (max-width: 768px) {
    .pagination-jump {
        display: none; /* 小屏幕隐藏跳转 */
    }
    
    #pagination {
        gap: 3px;
    }
    
    #pagination .btn {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 0 6px;
    }
}

/*客户管理页面的搜索组件*/
/* ===== 搜索框容器 ===== */
.ci-search-box {
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ===== 主搜索栏 ===== */
.ci-search-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* 输入框通用样式 */
.ci-search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.ci-search-field input,
.ci-search-field select {
    height: 36px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.ci-search-field input:hover,
.ci-search-field select:hover {
    border-color: #c0c4cc;
}

.ci-search-field input:focus,
.ci-search-field select:focus {
    border-color: #409eff;
    outline: none;
}

/* 关键字搜索框 */
.ci-keyword-field {
    flex: 1;
    min-width: 200px;
}

.ci-keyword-field .ci-icon-search {
    position: absolute;
    left: 12px;
    color: #909399;
    font-size: 14px;
    z-index: 1;
}

.ci-keyword-field input {
    width: 100%;
    padding-left: 36px;
    padding-right: 12px;
}

/* 状态下拉框 */
.ci-status-field select {
    width: 120px;
    cursor: pointer;
    color: #606266;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239C9C9C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* 按钮样式 */
.ci-btn {
    height: 36px;
    padding: 0 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.ci-btn-primary {
    background: #409eff;
    color: #fff;
}

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

.ci-btn-secondary {
    background: #fff;
    color: #606266;
    border: 1px solid #dcdfe6;
}

.ci-btn-secondary:hover {
    color: #409eff;
    border-color: #409eff;
    background: #ecf5ff;
}

.ci-btn-text {
    background: transparent;
    color: #606266;
    padding: 0 12px;
}

.ci-btn-text:hover {
    color: #409eff;
}

.ci-btn-text i {
    font-size: 12px;
    transition: transform 0.3s;
    display: inline-block;
    font-style: normal;
}

.ci-btn-text.active i {
    transform: rotate(180deg);
}

/* ===== 高级筛选区域（位于主搜索栏下方） ===== */
.ci-advanced-filter {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #ebeef5;
    animation: ci-slideDown 0.3s ease;
}

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

/* 筛选行：横向排列 */
.ci-filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.ci-filter-row:last-of-type {
    margin-bottom: 0;
}

/* 筛选组 */
.ci-filter-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ci-filter-group label {
    font-size: 13px;
    color: #606266;
    font-weight: 500;
    white-space: nowrap;
}

.ci-filter-group input[type="text"] {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.ci-filter-group input[type="text"]:hover {
    border-color: #c0c4cc;
}

.ci-filter-group input[type="text"]:focus {
    border-color: #409eff;
    outline: none;
}

/* 时间筛选行特殊样式 */
.ci-time-row {
    background: #f5f7fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ebeef5;
}

.ci-time-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.ci-time-group label {
    min-width: 60px;
    margin-bottom: 0;
}

/* 日期范围 */
.ci-date-range {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ci-date-range input[type="date"] {
    flex: 1;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 13px;
    color: #606266;
    min-width: 0;
    background: #fff;
}

.ci-date-range input[type="date"]:hover {
    border-color: #c0c4cc;
}

.ci-date-range input[type="date"]:focus {
    border-color: #409eff;
    outline: none;
}

.ci-date-range span {
    color: #909399;
    font-size: 12px;
    flex-shrink: 0;
}

/* 筛选操作栏 */
.ci-filter-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px dashed #dcdfe6;
}

/* ===== 响应式适配 ===== */
@media (max-width: 1200px) {
    .ci-filter-row {
        flex-wrap: wrap;
    }
    
    .ci-filter-group {
        flex: 1 1 calc(33.333% - 14px);
        min-width: 200px;
    }
    
    .ci-time-row .ci-filter-group {
        flex: 1 1 100%;
    }
    
    .ci-time-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .ci-time-group label {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .ci-search-main {
        flex-wrap: wrap;
    }
    
    .ci-keyword-field {
        width: 100%;
        min-width: auto;
    }
    
    .ci-status-field,
    .ci-btn {
        flex: 1;
    }
    
    .ci-filter-group {
        flex: 1 1 100%;
    }
}

 /* 编辑模态框移动端优化 */
    @media (max-width: 768px) {
        #editModal .min-h-screen {
            align-items: flex-end !important;
        }
        
        #editModal .bg-white {
            border-bottom-left-radius: 0 !important;
            border-bottom-right-radius: 0 !important;
            max-height: 90vh !important;
        }
        
        #editModal .sticky.bottom-0 {
            background: white;
            box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
        }
        
        /* 按钮在移动端更大，易于点击 */
        #editModal .bottom-0 button {
            padding-top: 0.75rem;
            padding-bottom: 0.75rem;
            font-size: 1rem;
        }
        
        /* 调整滚动内容的内边距 */
        #modalScrollContent {
            padding-bottom: 5rem !important;
        }
    }
    
    /* 确保按钮在任何设备上都可见 */
    #editModal .sticky.bottom-0 {
        z-index: 30;
    }