* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

header h1 {
    font-size: 28px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
    color: #667eea;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

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

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

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

.stat-value {
    color: #667eea;
    font-size: 32px;
    font-weight: bold;
}

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

.search-container {
    padding: 20px 30px;
    display: flex;
    gap: 10px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.search-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

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

/* 订单卡片样式 */
.orders-container {
    padding: 30px;
}

.order-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s;
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.order-header {
    padding: 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-header:hover {
    background: #e9ecef;
}

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

.order-info-item {
    display: flex;
    flex-direction: column;
}

.order-info-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.order-info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.order-toggle {
    font-size: 24px;
    color: #667eea;
    transition: transform 0.3s;
}

.order-toggle.expanded {
    transform: rotate(180deg);
}

.order-products {
    display: none;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.order-products.show {
    display: block;
}

.product-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.product-details {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    align-items: center;
}

.product-name {
    font-weight: 500;
    color: #333;
}

.product-spec {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.product-barcode {
    font-family: 'Courier New', monospace;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.order-summary {
    padding: 15px 20px;
    background: #fff3cd;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-summary-text {
    font-weight: 600;
    color: #856404;
}

/* 配送信息样式 */
.shipping-info {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.shipping-info h4 {
    margin: 0 0 12px 0;
    color: #1976d2;
    font-size: 14px;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.info-item {
    display: flex;
    gap: 8px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    color: #666;
    font-size: 13px;
    font-weight: 500;
    min-width: 80px;
}

.info-value {
    color: #333;
    font-size: 13px;
}

.order-products h4 {
    margin: 0 0 15px 0;
    color: #4caf50;
    font-size: 14px;
    font-weight: 600;
}

.table-container {
    padding: 30px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
    background: #e3f2fd !important;
}

/* 同一订单的商品分组显示 */
tbody tr.order-group-1 {
    background: #ffffff;
}

tbody tr.order-group-2 {
    background: #f8f9fa;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.barcode {
    font-family: 'Courier New', monospace;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.pagination {
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    width: 120px;
    font-weight: 600;
    color: #666;
}

.detail-value {
    flex: 1;
    color: #333;
}

.btn-view {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

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