/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
    margin: 2px 0;
}

.navbar ul {
    list-style-type: none;
    display: flex;
}

.navbar ul li {
    margin-left: 20px;
}

.navbar ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

/* 主体内容区（预留空间给固定头部） */
.main-content {
    margin-top: 80px; /* 为固定头部留出空间 */
    padding: 2rem 0;
}

/* 页脚 (保持不变) */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem 0;
}

.footer p {
    margin: 5px 0;
}
.footer p {
    margin: 5px 0;
}
.footer a {
    color: #ffffff;           /* 默认灰色 */
    text-decoration: none; /* 去掉下划线（可选） */
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #444;           /* 鼠标悬停时稍深一点，保持低调 */
}

.footer a:visited {
    color: #777;           /* 访问过后依然是柔和的灰色，不刺眼 */
}
/* 入库管理页面样式 */
.inventory-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.inventory-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.inventory-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.inventory-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.section:last-child {
    border-bottom: none;
}

.section h3, .section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.section h4 {
    font-size: 1rem;
    color: #3498db;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.auto-save {
    background-color: #e8f4fd;
    color: #0a7cff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 10px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

button {
    padding: 12px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.scan { background-color: #3498db; color: white; }
.add { background-color: #2ecc71; color: white; }
.export { background-color: #f39c12; color: white; }
.mini { padding: 5px 10px; font-size: 0.9rem; }

.hidden { display: none !important; }

.unit-section {
    display: flex;
    gap: 10px;
}

.weight-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.weight-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weight-item input {
    flex: 1;
    margin-bottom: 0;
}

.weight-item button {
    flex: 0 0 auto;
    padding: 8px 12px;
    min-width: auto;
}

.add-weight-btn {
    background-color: #9b59b6;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 15px;
}

.input-with-label {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.input-label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.input-field {
    width: 100%;
}

.result-list {
    background-color: #f9f9f9;
}

.result-list h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#itemCount {
    background-color: #3498db;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.result-item {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.name-part {
    flex: 1;
}

.delete-part {
    align-self: flex-end;
}

.delete-part button {
    background-color: #e74c3c;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    max-width: 120px;
}

@media (min-width: 768px) {
    .action-buttons {
        flex-direction: row;
    }

    button {
        min-width: 140px;
    }

    .weight-item {
        flex-direction: row;
    }

    .result-item {
        flex-direction: row;
        align-items: center;
    }

    .delete-part {
        align-self: auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .inventory-header h1 {
        font-size: 1.5rem;
    }

    .section {
        padding: 15px;
    }

    button {
        min-width: auto;
        padding: 10px;
    }

    .weight-item input {
        min-width: 0;
    }
}