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

body {
    font-family: "Microsoft YaHei", "SimSun", serif;
    background: #f5f0e6;
    background-image: 
        linear-gradient(rgba(139, 90, 43, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 90, 43, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 3px double #8B5A2B;
    margin-bottom: 30px;
    position: relative;
}

.header::before,
.header::after {
    content: "◆";
    color: #8B5A2B;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.header::before { left: 20%; }
.header::after { right: 20%; }

h1 {
    color: #5D4037;
    font-size: 32px;
    font-weight: normal;
    letter-spacing: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

h2 {
    background: linear-gradient(to bottom, #8B5A2B, #6D4C41);
    color: #FFF8E7;
    padding: 15px 25px;
    font-size: 22px;
    font-weight: normal;
    letter-spacing: 4px;
    border-bottom: 2px solid #5D4037;
    margin-bottom: 0;
}

.nav {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(to bottom, #D7CCC8, #BCAAA4);
    border: 2px solid #8B5A2B;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

.nav a {
    color: #4E342E;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s;
}

.nav a:hover {
    color: #8B5A2B;
}

.section {
    margin-bottom: 40px;
    background: #FFF8E7;
    border: 3px solid #8B5A2B;
    border-radius: 8px;
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.1),
        inset 0 0 30px rgba(139, 90, 43, 0.05);
    overflow: hidden;
}

.form-container {
    padding: 25px;
    background: linear-gradient(to bottom, #FFF8E7, #F5F0E6);
}

.form-container h3 {
    color: #6D4C41;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #D7CCC8;
    letter-spacing: 2px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 150px;
}

label {
    display: block;
    color: #5D4037;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #A1887F;
    border-radius: 4px;
    background: #FFF;
    color: #4E342E;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #8B5A2B;
    box-shadow: 0 0 5px rgba(139, 90, 43, 0.3);
}

input::placeholder {
    color: #BCAAA4;
}

.product-item, .material-item {
    background: rgba(139, 90, 43, 0.05);
    border: 1px solid #D7CCC8;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-item .form-group, .material-item .form-group {
    flex: 1;
    min-width: 120px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}

.btn-primary {
    background: linear-gradient(to bottom, #8B5A2B, #6D4C41);
    color: #FFF8E7;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #A1887F, #8B5A2B);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #D7CCC8;
    color: #5D4037;
    border: 2px solid #8B5A2B;
}

.btn-secondary:hover {
    background: #BCAAA4;
}

.btn-danger {
    background: #8B5A2B;
    color: #FFF8E7;
    padding: 8px 15px;
    font-size: 13px;
}

.btn-danger:hover {
    background: #A1887F;
}

.table-container {
    padding: 25px;
    background: #FFF8E7;
    border-top: 2px solid #8B5A2B;
}

.table-container h3 {
    color: #6D4C41;
    font-size: 18px;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #FFF;
    border: 2px solid #8B5A2B;
}

th, td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #D7CCC8;
}

th {
    background: linear-gradient(to bottom, #8B5A2B, #6D4C41);
    color: #FFF8E7;
    font-weight: normal;
    letter-spacing: 1px;
}

tr:nth-child(even) {
    background: #F5F0E6;
}

tr:hover {
    background: #EFEBE9;
}

.empty-row td {
    color: #8D6E63;
    font-style: italic;
    padding: 30px;
}

.action-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-btns .btn {
    padding: 6px 12px;
    font-size: 12px;
}

#products-container, #materials-container, #production-materials-container {
    margin-bottom: 15px;
}

.buttons-row {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

button {
    background-color: #8B5A2B;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

button:hover {
    background-color: #6D4C41;
}

.menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.menu-item {
    background: #FFF8E7;
    padding: 30px;
    border: 2px solid #8B5A2B;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #5D4037;
    transition: all 0.3s ease;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(139, 90, 43, 0.3);
    background: #FFF;
}

.menu-item h2 {
    background: none;
    color: #8B5A2B;
    padding: 0;
    border: none;
    margin-bottom: 10px;
}

.menu-item p {
    color: #8D6E63;
}

/* 响应式设计 - 适配手机和平板 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
    }
    
    .header {
        padding: 20px 0;
    }
    
    .header::before,
    .header::after {
        display: none;
    }
    
    h1 {
        font-size: 22px;
        letter-spacing: 4px;
    }
    
    h2 {
        font-size: 18px;
        letter-spacing: 2px;
    }
    
    .nav {
        padding: 10px;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .nav a {
        margin: 0 8px;
        font-size: 14px;
    }
    
    .section {
        margin-bottom: 20px;
    }
    
    .section h2 {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group {
        min-width: 100%;
        width: 100%;
    }
    
    label {
        font-size: 13px;
    }
    
    input, select, textarea {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .buttons-row {
        flex-direction: column;
    }
    
    .buttons-row .btn {
        width: 100%;
    }
    
    table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }
    
    th, td {
        padding: 8px 5px;
        white-space: nowrap;
    }
    
    .action-btns {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-btns .btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .menu {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .menu-item {
        padding: 20px 15px;
    }
    
    .menu-item h2 {
        font-size: 18px;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        padding: 15px;
    }
    
    .modal-btns {
        flex-direction: column;
    }
    
    .modal-btns .btn {
        width: 100%;
    }
    
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        width: 100%;
        padding: 10px;
    }
    
    .product-item {
        flex-direction: column;
    }
    
    .product-item .form-group {
        width: 100%;
    }
    
    .checkbox-cell {
        padding: 5px;
    }
    
    .order-checkbox {
        width: 24px;
        height: 24px;
    }
    
    .customer-info p {
        font-size: 14px;
    }
    
    .year-info {
        font-size: 16px;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
    
    .form-row {
        flex-wrap: wrap;
    }
    
    .form-group {
        min-width: 200px;
    }
    
    .menu {
        grid-template-columns: repeat(2, 1fr);
    }
    
    table {
        font-size: 13px;
    }
}
