* {
    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;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 数据操作按钮 */
.data-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-export, .btn-import {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-export {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-import {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-import:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

.nav-tab {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: #667eea;
    color: white;
}

.nav-tab.active {
    background: #667eea;
    color: white;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.card h2 {
    color: #333;
    font-size: 1.8rem;
}

/* Tab内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 表单样式 */
.form {
    max-width: 900px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

/* 输入框带按钮 */
.input-with-button {
    display: flex;
    gap: 5px;
}

.input-with-button input,
.input-with-button select {
    flex: 1;
}

.btn-small {
    padding: 0 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 40px;
}

.btn-small:hover {
    background: #5568d3;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 图片上传 */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    display: none;
}

.upload-placeholder {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
    font-size: 1.1rem;
}

.upload-placeholder:hover {
    background: rgba(102, 126, 234, 0.05);
}

.upload-placeholder.has-image {
    padding: 20px;
}

.upload-placeholder img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

/* 按钮样式 */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.btn {
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(235, 51, 73, 0.4);
}

.btn-add {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 搜索框 */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.product-image {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image .placeholder {
    color: #999;
    font-size: 3rem;
}

.product-info {
    padding: 15px;
}

.product-code {
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.product-name {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-detail {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.product-price {
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
}

.product-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.product-actions .form-row {
    margin-bottom: 0;
}

.product-actions input {
    padding: 8px;
    font-size: 0.9rem;
}

.btn-add-cart {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

/* 报价单 */
.add-product-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.add-product-section select,
.add-product-section input {
    flex: 1;
    min-width: 150px;
}

.quotation-items {
    margin-top: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.quotation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.quotation-item-info {
    flex: 1;
    min-width: 200px;
}

.quotation-item-qty,
.quotation-item-price,
.quotation-item-total {
    text-align: center;
    min-width: 100px;
}

.quotation-item-qty input,
.quotation-item-price input {
    width: 80px;
    text-align: center;
}

.quotation-item-remove {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quotation-item-remove:hover {
    background: #ee5a5a;
}

.quotation-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 25px;
    margin-top: 25px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.summary-item.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1.3rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .nav-tab {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .quotation-item {
        flex-direction: column;
        text-align: left;
    }

    .quotation-item-qty,
    .quotation-item-price,
    .quotation-item-total {
        text-align: left;
    }
}

/* 同步状态指示器 */
.sync-status {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 15px;
    color: #666;
}

.sync-status.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.sync-status.error {
    background: #ffebee;
    color: #c62828;
}

/* 用户状态栏 */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.user-status {
    padding: 8px 16px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 20px;
    font-size: 0.9rem;
}

.user-status.user-disabled {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* 删除产品按钮 */
.btn-delete-product {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

/* 用户统计样式 */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

.stat-item {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.stat-value.pending {
    color: #ff9800;
}

/* 筛选器样式 */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-row select,
.filter-row input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
}

.filter-row select {
    min-width: 120px;
}

.filter-row input {
    flex: 1;
    min-width: 200px;
}

/* 用户表格样式 */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

.users-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.users-table tr:hover {
    background: #fafafa;
}

.type-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.status-badge.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.status-approved {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-rejected {
    background: #ffebee;
    color: #c62828;
}

/* 系统管理面板样式 */
.admin-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.admin-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    color: #333;
}

.admin-section .help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.admin-section .help-text.warning {
    color: #d32f2f;
    font-weight: 500;
}

.admin-section .button-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-section .form-group {
    margin-bottom: 15px;
}

.admin-section .form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.admin-section .form-group select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

/* 卡片头部样式 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2 {
    margin: 0;
}

/* 危险按钮样式 */
.btn-danger {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c62828 0%, #9a1515 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
}

.btn-delete-product:hover {
    background: #ffcdd2;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-form {
    padding: 25px;
}

.modal-form .form-group {
    margin-bottom: 15px;
}

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

.modal-form .form-group input,
.modal-form .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.modal-form .form-group input:focus,
.modal-form .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.modal-form .form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.modal-form .form-actions .btn {
    width: 100%;
}

/* 用户管理表格 */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

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

.users-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.users-table tr:hover {
    background: #f9f9f9;
}

.users-table .type-select {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.85rem;
}

/* 状态徽章 */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-approved {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-rejected {
    background: #ffebee;
    color: #c62828;
}

/* 按钮颜色增强 */
.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #43a047;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #fb8c00;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 产品卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image .placeholder {
    font-size: 60px;
    color: #ccc;
}

.product-info {
    padding: 15px;
}

.product-code {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
}

.product-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 5px 0;
    color: #333;
}

.product-detail {
    color: #666;
    font-size: 0.85rem;
    margin: 3px 0;
}

.product-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #e91e63;
    margin: 10px 0;
}

.product-actions {
    margin-top: 10px;
}

.btn-delete-product {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.btn-delete-product:hover {
    background: #d32f2f;
}

.btn-add-cart {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-add-cart:hover {
    opacity: 0.9;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 1.1rem;
}

/* 搜索栏 */
.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.search-bar select {
    min-width: 150px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.search-bar select:focus {
    outline: none;
    border-color: #667eea;
}

/* 报价库样式 */
.library-actions {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.library-actions .help-text {
    color: #666;
    font-size: 0.9rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

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

.data-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.data-table tr:hover {
    background: #fafafa;
}

.status-badge.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-warning {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.status-expired {
    background: #ffebee;
    color: #c62828;
}

/* 表格滚动容器 */
#quotationLibraryContent {
    max-height: 600px;
    overflow-y: auto;
}

#quotationLibraryContent table {
    border: 1px solid #eee;
    border-radius: 8px;
}
