* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Segoe UI", Tahoma, sans-serif;
    background: #f5f6fa;
    color: #333;
}

.navbar {
    background: #2c3e50;
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-brand {
    font-size: 18px;
    font-weight: bold;
    margin-right: 40px;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.nav-link.active {
    background: #3498db;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(52,152,219,0.5);
}

.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

select.form-control {
    height: 36px;
}

.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: visible;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

tr:hover {
    background: #f8f9fa;
}

.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.alert-success {
    background: #d5f5e3;
    color: #1e8449;
    border: 1px solid #abebc6;
}

.alert-danger {
    background: #fadbd8;
    color: #c0392b;
    border: 1px solid #f1948a;
}

.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar label {
    font-weight: 600;
    color: #555;
}

.field-validation-error {
    color: #e74c3c;
    font-size: 13px;
}

.hint {
    color: #888;
    font-size: 13px;
    margin-top: 2px;
}

.multi-select {
    max-width: 400px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 8px;
    background: #fff;
}

.multi-select label {
    display: block;
    padding: 4px 0;
    font-weight: normal;
}

.multi-select input[type="checkbox"] {
    margin-right: 8px;
}

.amount-display {
    font-size: 18px;
    font-weight: bold;
    color: #e67e22;
    padding: 8px 0;
}

/* 卸货明细字典：放宽页面，控件排成一行 */
.dict-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 20px;
}

.dict-toolbar .form-control {
    max-width: none;
    width: auto;
    min-width: 200px;
    flex: 0 1 auto;
}

.dict-toolbar .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.dict-table {
    table-layout: auto;
}

.dict-table th.col-idx,
.dict-table td.col-idx {
    width: 60px;
    white-space: nowrap;
}

.dict-table th.col-weight,
.dict-table td.col-weight {
    width: 160px;
    white-space: nowrap;
}

.dict-table th.col-ops,
.dict-table td.col-ops {
    white-space: nowrap;
}

.dict-ops {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
}

.dict-edit {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.dict-edit .form-control {
    max-width: none;
    width: auto;
    min-width: 140px;
}

.dict-delete {
    display: inline-flex;
    align-items: center;
}

/* 卸货记录编辑：吨位公式工具条 */
.tonnage-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
}

.tonnage-toolbar .form-control {
    max-width: 250px;
    flex: 0 1 auto;
}

.tonnage-toolbar .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* 卸货记录编辑：称重明细操作工具条 */
.detail-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.detail-toolbar .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.detail-toolbar .hint {
    margin-left: 4px;
}

/* 导航多级下拉菜单 */
.nav-links .dropdown {
    position: relative;
    display: inline-block;
}

.nav-links .dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-links .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #34495e;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    padding: 4px 0;
    display: none;
    z-index: 1000;
}

.nav-links .dropdown:hover > .dropdown-menu,
.nav-links .dropdown.open > .dropdown-menu {
    display: block;
}

.nav-links .dropdown-item {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 16px;
    white-space: nowrap;
    transition: background 0.15s;
}

.nav-links .dropdown-item:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.nav-links .dropdown-item.active {
    background: #3498db;
    color: #fff;
    font-weight: 600;
}

.nav-links .dropdown.active-parent > .dropdown-toggle {
    background: rgba(52,152,219,0.35);
    color: #fff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .nav-links {
        flex-wrap: wrap;
    }

    .nav-links .dropdown-menu {
        position: static;
        box-shadow: none;
    }
}

/* 卸货明细可搜索下拉（combobox） */
.combobox {
    position: relative;
}

.combobox-panel {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    width: 200px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.combobox-panel .cb-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.combobox-panel .cb-item:hover {
    background: #ecf0f1;
}
