/* ===== 库房管理系统 - 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* ===== 顶部导航栏 ===== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.user-info span { color: rgba(255,255,255,0.9); }

.user-info a {
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    transition: background 0.2s;
    font-size: 13px;
}

.user-info a:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== 主容器 ===== */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 16px;
}

/* ===== 搜索卡片 ===== */
.search-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.search-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    border-left: 4px solid #667eea;
    padding-left: 12px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.form-group {
    flex: 3;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fafafa;
}

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

/* ===== 按钮 ===== */
.btn {
    padding: 11px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.2s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-add { background: #28a745; }
.btn-user { background: #17a2b8; }

/* ===== 结果卡片 ===== */
.result-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow-x: auto;
    margin-bottom: 20px;
}

/* ===== 表格 ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    border: 1px solid #e8e8e8;
    padding: 12px 10px;
    text-align: left;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #fafafa;
}

/* ===== 操作按钮 ===== */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.2s;
}

.action-buttons button:hover {
    opacity: 0.85;
}

.btn-edit { background: #ffc107; color: #333; }
.btn-delete { background: #dc3545; color: white; }
.btn-deluser { background: #dc3545; color: white; }
.btn-pass { background: #28a745; color: white; }
.btn-reject { background: #ffc107; color: #333; }

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 500px;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fafafa;
}

.modal-content input:focus,
.modal-content select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

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

.btn-cancel {
    background: #f0f0f0;
    color: #555;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 状态标签 ===== */
.status-pending { color: #ffc107; font-weight: 600; }
.status-approved { color: #28a745; font-weight: 600; }
.status-rejected { color: #dc3545; font-weight: 600; }

/* ===== 统计信息 ===== */
.count-info {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4f8;
    border-radius: 8px;
    text-align: center;
    color: #667eea;
    font-size: 14px;
}

/* ===== Loading 状态 ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(102,126,234,0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .search-form { flex-direction: column; }
    .form-group { width: 100%; }
    
    /* 移动端表格优化 */
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    /* 隐藏次要列 */
    table th:nth-child(7),
    table th:nth-child(8),
    table th:nth-child(9),
    table td:nth-child(7),
    table td:nth-child(8),
    table td:nth-child(9) {
        display: none;
    }
}

@media print {
    .header, .search-card, .action-buttons { display: none; }
}
