/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,0.2);
}

.balance-info {
    font-size: 16px;
    font-weight: 500;
}

/* 搜索区域 */
.search-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.search-section h2 {
    margin-bottom: 15px;
    color: #333;
}

.search-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #5568d3;
}

/* 商品列表 */
.products-section {
    padding: 30px;
}

.products-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: block;
    border-radius: 10px;
}

.product-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.product-price {
    font-size: 24px;
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.product-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.product-stock {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
}

.stock-item {
    color: #888;
}

.product-avg {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
    margin-bottom: 15px;
}

.product-avg.warning {
    background: #fff3e0;
    color: #f57c00;
}

.product-avg.danger {
    background: #ffebee;
    color: #c62828;
}

.btn-order {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-order:hover {
    background: #5568d3;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group label.warning {
    color: #e74c3c;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.remark-text {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 10px;
    border-radius: 5px;
    color: #856404;
    font-size: 13px;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* 订单页面 */
.order-search-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.order-search-box select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.order-search-box input {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.order-section {
    padding: 30px;
    border-top: 1px solid #e0e0e0;
}

.order-detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-label {
    color: #666;
    font-weight: 500;
}

.order-info-value {
    color: #333;
    font-weight: bold;
}

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.status-1 { background: #e3f2fd; color: #1976d2; }
.status-2 { background: #fff3e0; color: #f57c00; }
.status-3 { background: #e8f5e9; color: #388e3c; }
.status-4 { background: #c8e6c9; color: #2e7d32; }
.status-5 { background: #fff9c4; color: #f9a825; }
.status-6 { background: #ffebee; color: #c62828; }
.status-7 { background: #f3e5f5; color: #7b1fa2; }

.order-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.order-actions button {
    padding: 10px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-confirm {
    background: #4caf50;
    color: white;
}

.btn-confirm:hover {
    background: #45a049;
}

.btn-cancel {
    background: #f44336;
    color: white;
}

.btn-cancel:hover {
    background: #da190b;
}

.orders-list-section {
    padding: 30px;
    background: #f8f9fa;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.order-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
}

/* 余额页面 */
.balance-section {
    padding: 30px;
}

.balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.balance-amount {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
}

.currency {
    font-size: 32px;
    opacity: 0.8;
}

.amount {
    margin-left: 10px;
}

.balance-info-text {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.btn-refresh {
    padding: 10px 30px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-refresh:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.balance-tips {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.balance-tips h3 {
    margin-bottom: 15px;
    color: #333;
}

.balance-tips ul {
    list-style: none;
}

.balance-tips li {
    padding: 8px 0;
    color: #666;
    position: relative;
    padding-left: 25px;
}

.balance-tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        max-width: 90%;
    }
    
    .balance-amount {
        font-size: 36px;
    }
}
