/* ========== 前台查询页面样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.header {
    text-align: center;
    padding: 40px 20px;
    color: #fff;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

/* 卡片容器 */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    margin-bottom: 24px;
}

/* 搜索区域 */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

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

.search-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.35);
}

.search-btn svg { width: 20px; height: 20px; }

/* 快速统计 */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-stat {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.quick-stat.blue { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.quick-stat.green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.quick-stat.orange { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.quick-stat.purple { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

.quick-stat .number {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.quick-stat .label {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}

/* 商品列表 */
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.goods-card {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.goods-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.goods-card .goods-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.goods-card .goods-code {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
}

.goods-card .goods-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goods-card .stock {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.goods-card .stock.warning { color: #f39c12; }
.goods-card .stock.danger { color: #e74c3c; }

.goods-card .price {
    font-size: 18px;
    font-weight: 600;
    color: #e74c3c;
}

.goods-card .barcode-img {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* 商品详情弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.show { display: flex; }

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

.modal-body { padding: 20px; }

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.detail-item .label { color: #888; }
.detail-item .value { color: #333; font-weight: 500; }

/* 出入库动态 */
.flow-list {
    max-height: 300px;
    overflow-y: auto;
}

.flow-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.flow-item .flow-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.flow-item .flow-type.in {
    background: #e8f5e9;
    color: #2e7d32;
}

.flow-item .flow-type.out {
    background: #ffebee;
    color: #c62828;
}

.flow-item .flow-info { flex: 1; padding: 0 12px; }
.flow-item .flow-time { color: #888; font-size: 12px; }

/* 链接按钮 */
.admin-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 24px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.admin-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

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

.pagination button {
    min-width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover {
    border-color: #667eea;
}

.pagination button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
    .header h1 { font-size: 24px; }
    .search-box { flex-direction: column; }
    .search-btn { width: 100%; justify-content: center; }
    .goods-grid { grid-template-columns: 1fr; }
    .quick-stats { grid-template-columns: repeat(2, 1fr); }
}
