/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    padding-top: 15px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 1.5rem;
    border-radius: 0 0 16px 16px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    color: #2d3748;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
}

.header h1 i {
    color: #667eea;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-right: 1rem;
}

.user-info span {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.95rem;
}

.logout-btn {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(229, 62, 62, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
}

/* 主内容区域 */
.main-content {
    padding: 0.5rem 0 2rem 0;
}

/* 搜索区域 */
.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.search-box {
    flex: 1;
    min-width: 320px;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
    background: linear-gradient(135deg, #667eea, #5a67d8);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #718096, #4a5568) !important;
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(113, 128, 150, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(113, 128, 150, 0.4);
}

.add-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(72, 187, 120, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

/* 数据容器 */
.data-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* 表格样式 */
.sales-table {
    width: 100%;
    border-collapse: collapse;
    min-height: 400px;
}

.sales-table thead {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-bottom: 2px solid #e2e8f0;
}

.sales-table th {
    padding: 1rem 1.2rem;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.sales-table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: #e2e8f0;
}

.sales-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.sales-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    transform: translateX(4px);
}

.sales-table tbody tr:last-child {
    border-bottom: none;
}

.sales-table td {
    padding: 0.8rem 1.2rem;
    vertical-align: middle;
    position: relative;
}

.sales-table td:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: #f1f5f9;
}

.customer-name {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.95rem;
}

.customer-phone {
    color: #2d3748;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-聊天 { 
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4); 
    color: #2f855a; 
}
.status-无效 { 
    background: linear-gradient(135deg, #fed7d7, #feb2b2); 
    color: #c53030; 
}

.salesman-name {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
}

.created-date {
    color: #4a5568;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* 加载指示器 */
.loading-indicator, .no-more-data {
    text-align: center;
    padding: 3rem 2rem;
    color: #718096;
    font-size: 1rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.loading-indicator i {
    margin-right: 0.5rem;
    color: #667eea;
    font-size: 1.2rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.4s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 2rem 2rem 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 700;
}

.close {
    color: #a0aec0;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close:hover {
    color: #4a5568;
    background: #e2e8f0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[readonly] {
    background: #f7fafc;
    color: #4a5568;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.form-group input[readonly]:focus {
    border-color: #e2e8f0;
    box-shadow: none;
}

/* 详情修改页面的表单样式 - 标签和输入框在同一行 */
#editDataForm .form-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#editDataForm .form-group label {
    min-width: 100px;
    margin-bottom: 0;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

#editDataForm .form-group input,
#editDataForm .form-group select {
    flex: 1;
    margin: 0;
}

/* 表单容器样式 */
form {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1.5rem 2rem 2rem 2rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 1rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 0 0 20px 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #5a67d8);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    color: #4a5568;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
    transform: translateY(-2px);
}

/* 数据详情样式 */
.data-detail {
    padding: 2rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.detail-value {
    color: #4a5568;
    font-weight: 500;
}

/* 登录页面样式 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    color: #2d3748;
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-header p {
    color: #718096;
    font-size: 1rem;
}

.error-message {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 500;
    border: 1px solid #feb2b2;
}

.login-form .form-group {
    margin-bottom: 2rem;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.95rem;
}

.login-form label i {
    color: #667eea;
    font-size: 1.1rem;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #5a67d8);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.admin-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.admin-link:hover {
    color: #5a67d8;
    background: #f7fafc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        padding-top: 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .user-info {
        margin-right: 0;
    }
    
    .header h1 {
        font-size: 1.2rem;
        margin-left: 0;
    }
    
    .search-section {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .sales-table {
        font-size: 0.85rem;
    }
    
    .sales-table th,
    .sales-table td {
        padding: 0.6rem 0.8rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.8rem;
        justify-content: center;
        align-items: center;
    }
    
    form {
        padding: 1.5rem;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* 移动端详情修改表单样式 */
    #editDataForm .form-group {
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
        margin-bottom: 1.2rem;
    }
    
    #editDataForm .form-group label {
        min-width: 80px;
        margin-bottom: 0;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    #editDataForm .form-group input,
    #editDataForm .form-group select {
        flex: 1;
        min-width: 0;
    }
    
    /* 确保模态框可以滚动 */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
        margin: 5vh auto;
    }
    
    /* 确保按钮区域始终可见 */
    .form-actions {
        position: sticky;
        bottom: 0;
        background: linear-gradient(135deg, #f8fafc, #f1f5f9);
        border-top: 1px solid #e2e8f0;
        margin-top: 1rem;
        padding: 1rem 2rem;
        z-index: 10;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .search-section {
        padding: 1.2rem;
        gap: 0.8rem;
    }
    
    .add-btn, .search-box button, .reset-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .header h1 {
        font-size: 1.1rem;
    }
    
    .login-box {
        padding: 2rem;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
        width: 98%;
    }
    
    form {
        padding: 1.2rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    /* 超小屏幕的详情修改表单优化 */
    #editDataForm .form-group {
        gap: 0.6rem;
        margin-bottom: 1rem;
    }
    
    #editDataForm .form-group label {
        min-width: 70px;
        font-size: 0.85rem;
    }
    
    .sales-table {
        font-size: 0.8rem;
    }
    
    .sales-table th,
    .sales-table td {
        padding: 0.5rem 0.6rem;
    }
    
    .sales-table th {
        font-size: 0.75rem;
    }
    
    .status-badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
} 