* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f6f7;
    color: #333;
    font-size: 14px;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #0a6ed1 0%, #085caf 100%);
    color: white;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    flex: 1;
}

.header-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 10px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    filter: brightness(0) invert(1);
}

.header-logo:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.header-logo:active {
    opacity: 0.6;
    transform: scale(0.95);
}

.content {
    flex: 1;
    padding: 12px;
    padding-bottom: 70px;
}

.page {
    animation: fadeIn 0.3s ease;
}

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

.stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-card.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.stat-card.clickable:active {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.stat-card.clickable:hover {
    box-shadow: 0 4px 12px rgba(29,158,117,0.2);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #0a6ed1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

.scan-box-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dropdown-group {
    position: relative;
}

.dropdown-input {
    cursor: pointer;
    background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding-right: 32px !important;
}

.dropdown-input:focus {
    background-color: white;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown-list.show {
    display: block;
}

.dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: #e6f1fb;
    color: #0a6ed1;
}

.dropdown-item .item-sub {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.dropdown-loading {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.query-result-card {
    margin-bottom: 12px;
}

.query-result-card .packing-header {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.color-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-completed {
    background: linear-gradient(135deg, #eaf7f1 0%, #d9efdf 100%);
    border-color: #9fe1cb;
}

.legend-packing {
    background: linear-gradient(135deg, #fdf3dd 0%, #fae8bd 100%);
    border-color: #efc98a;
}

.legend-unpacked {
    background: linear-gradient(135deg, #fdf0ef 0%, #f9dcdb 100%);
    border-color: #f0b4b3;
}

.query-result-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.query-result-item {
    background: white;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.query-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.query-result-item:active {
    background: #e6f1fb;
}

.box-type-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    vertical-align: middle;
}

.box-type-mixed {
    background: #e6f1fb;
    color: #185fa5;
    border: 1px solid #85b7eb;
}

.box-type-standard {
    background: #d9efdf;
    color: #0f6e56;
    border: 1px solid #9fe1cb;
}

.status-completed-bg {
    background: linear-gradient(135deg, #eaf7f1 0%, #d9efdf 100%);
    border: 1px solid #9fe1cb;
}

.status-completed-bg:hover {
    background: linear-gradient(135deg, #d3ecdf 0%, #c3e4d1 100%);
}

.status-packing-bg {
    background: linear-gradient(135deg, #fdf3dd 0%, #fae8bd 100%);
    border: 1px solid #efc98a;
}

.status-packing-bg:hover {
    background: linear-gradient(135deg, #fae8bd 0%, #efc98a 100%);
}

.status-unpacked-bg {
    background: linear-gradient(135deg, #fdf0ef 0%, #f9dcdb 100%);
    border: 1px solid #f0b4b3;
}

.status-unpacked-bg:hover {
    background: linear-gradient(135deg, #f6d6d5 0%, #f0b4b3 100%);
}

.result-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

.result-detail + .result-detail {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #f0f0f0;
}

.result-detail span {
    
}

.modal-result-list .query-result-list {
    grid-template-columns: repeat(2, 1fr);
}

.result-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.result-boxcode {
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

.result-boxno {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}

.result-custrow {
    font-size: 13px;
    color: #666;
    margin: 2px 0 2px;
    padding: 2px 0 0;
    line-height: 1.4;
    text-align: left;
}
.result-custrow .cust-val {
    color: #0a6ed1;
    font-family: monospace;
    font-weight: 600;
    word-break: break-all;
    display: inline-block;
}

.record-custrow {
    font-size: 12px;
    color: #666;
    padding: 0 0 6px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
    line-height: 1.4;
}
.record-custrow .cust-val {
    color: #0a6ed1;
    font-family: monospace;
    font-weight: 600;
    word-break: break-all;
}

.result-header .box-type-tag {
    margin-left: 8px;
    flex-shrink: 0;
}

.result-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

.result-detail span {
    color: #666;
}

.field-value {
    font-weight: 600;
    color: #333;
}

.record-detail-item .field-value {
    font-weight: 600;
    color: #333;
}
}

.result-detail.mixed-sizes,
.mixed-sizes {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    display: flex !important;
}

.size-tag {
    display: inline-block !important;
    background: #e1f5ee !important;
    color: #1d9e75 !important;
    padding: 3px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    flex-shrink: 0 !important;
}

.color-tag {
    display: inline-block !important;
    background: #e8f0fe !important;
    color: #1a73e8 !important;
    padding: 3px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    flex-shrink: 0 !important;
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#progressMeta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
    vertical-align: middle;
}
#progressMeta .color-tag,
#progressMeta .size-tag {
    padding: 3px 10px !important;
    font-size: 14px !important;
}

.color-tag {
    display: inline-block !important;
    background: #e8f0fe !important;
    color: #1a73e8 !important;
    padding: 3px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    flex-shrink: 0 !important;
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.divider {
    display: flex;
    align-items: center;
    margin: 16px 0 8px;
    color: #ccc;
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
}

.divider span {
    padding: 0 12px;
}

.form-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.form-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.form-group .required {
    color: #e24b4a;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0a6ed1;
    background: white;
    box-shadow: 0 0 0 3px rgba(29,158,117,0.1);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #0a6ed1 0%, #085caf 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #0a6ed1 0%, #085caf 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e24b4a 0%, #c0392b 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ef9f27 0%, #d1840f 100%);
    color: white;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-scan {
    background: linear-gradient(135deg, #0a6ed1 0%, #085caf 100%);
    color: white;
    padding: 10px 20px;
    white-space: nowrap;
}

.box-scan-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border-radius: 10px;
}
.box-scan-btn.waiting {
    background: linear-gradient(135deg, #f0ad4e 0%, #e8920a 100%);
    animation: boxScanPulse 1.2s ease-in-out infinite;
}
@keyframes boxScanPulse {
    0%   { box-shadow: 0 0 0 0 rgba(240,173,78,0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(240,173,78,0); }
    100% { box-shadow: 0 0 0 0 rgba(240,173,78,0); }
}

.packing-active {
    animation: fadeIn 0.3s ease;
}

.packing-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 52px;
    z-index: 50;
}

.packing-header .color-legend {
    order: 2;
    margin-right: 0;
}

.packing-header .header-filter {
    order: 3;
}

.packing-header .back-btn {
    order: 4;
    margin-left: auto;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #0a6ed1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.back-btn:active {
    background: #e6f1fb;
}

.back-arrow {
    font-size: 18px;
    font-weight: bold;
}

.packing-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.header-filter {
    display: flex;
    justify-content: flex-start;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:hover {
    border-color: #0a6ed1;
}

.filter-select:focus {
    border-color: #0a6ed1;
    box-shadow: 0 0 0 2px rgba(29,158,117,0.1);
}

.packing-header-right {
    width: 50px;
}

.packing-info {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.info-row {
    display: flex;
    padding: 4px 0;
    font-size: 13px;
}

.info-label {
    color: #999;
    min-width: 70px;
}

.box-code {
    color: #0a6ed1;
    font-weight: 600;
    font-family: monospace;
}

.progress-section {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.progress-text strong {
    color: #0a6ed1;
    font-size: 16px;
}

.progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0a6ed1, #085caf);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.mixed-progress-container {
    margin-top: 8px;
}

.size-progress-item {
    margin-bottom: 10px;
}

.size-progress-item:last-child {
    margin-bottom: 0;
}

.size-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
}

.size-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.size-label .color-tag,
.size-label .size-tag {
    padding: 2px 8px !important;
    font-size: 12px !important;
}

.size-count {
    color: #666;
}

.size-scanned {
    color: #0a6ed1;
    font-weight: 600;
}

.scan-section {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.scan-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.scan-input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #0a6ed1;
    border-radius: 8px;
    font-size: 15px;
    background: #f0f6fd;
}

.scan-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29,158,117,0.2);
}

.scan-tip {
    font-size: 12px;
    color: #999;
    text-align: center;
}

.scan-tip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.scan-tip-row .scan-tip {
    text-align: center;
    flex: 1;
}

.auto-complete-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    padding: 0 8px;
    background: #f0f6fd;
    border-radius: 8px;
    border: 1px solid #85b7eb;
}

.auto-complete-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0a6ed1;
}

.scan-tip.success {
    color: #0a6ed1;
}

.scan-tip.error {
    color: #e24b4a;
}

.scanned-list {
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.list-title {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.list-content {
    max-height: 200px;
    overflow-y: auto;
}

#taskBoxList.list-content {
    max-height: none;
}

.scanned-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.scanned-item:last-child {
    border-bottom: none;
}

.scanned-barcode {
    font-family: monospace;
    color: #333;
}

.scanned-info {
    color: #999;
    font-size: 12px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.action-buttons .btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
}

.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    flex: 1;
    min-width: 80px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    height: auto;
    line-height: 1.4;
}

.filter-bar .btn {
    padding: 5px 14px;
    font-size: 13px;
    line-height: 1.4;
}

.record-list,
.barcode-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-boxcode {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.record-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.status-completed {
    background: #e1f5ee;
    color: #0f6e56;
}

.status-packing {
    background: #fdf0d5;
    color: #854f0b;
}

.status-unpacked {
    background: #fcebeb;
    color: #a32d2d;
}

.status-cancelled {
    background: #eee;
    color: #777;
}

.record-detail {
    font-size: 14px;
    color: #666;
    line-height: 2;
}

.record-detail span {
    margin-right: 16px;
    display: inline-block;
}

.barcode-stats {
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.barcode-card {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.barcode-code {
    font-family: monospace;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.barcode-meta {
    font-size: 12px;
    color: #999;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item.active {
    color: #0a6ed1;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 11px;
    color: #999;
}

.nav-item.active .nav-label {
    color: #0a6ed1;
    font-weight: 500;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 80%;
    text-align: center;
}

.toast-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-title {
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.modal-body {
    padding: 20px 16px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    text-align: center;
}

.modal-body .query-result-item {
    border: 1px solid #85b7eb;
    background: #f0f6fd;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.modal-body .query-result-item:hover {
    border-color: #0a6ed1;
    background: #e6f1fb;
    box-shadow: 0 2px 8px rgba(29,158,117,0.15);
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
}

.modal-footer .btn {
    width: 100%;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.info-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.info-boxcode-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.info-boxcode {
    font-size: 21px;
    font-weight: 800;
    color: #111;
    font-family: monospace;
    word-break: break-all;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.info-custcode {
    font-size: 13px;
    color: #0a6ed1;
    font-family: monospace;
    font-weight: 600;
    word-break: break-all;
    line-height: 1.3;
}

.info-status {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.info-status.status-packing {
    background: #fdf0d5;
    color: #854f0b;
}

.info-status.status-completed {
    background: #e1f5ee;
    color: #0f6e56;
}

.info-status.status-unpacked {
    background: #fcebeb;
    color: #a32d2d;
}

.info-grid-row {
    display: flex;
    gap: 12px;
    padding: 4px 0;
}

.info-item {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.info-item .info-label {
    color: #999;
    min-width: auto;
    margin-right: 4px;
}

.record-detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 4px 0;
}

.record-detail-item {
    font-size: 12px;
    color: #666;
    flex: 1;
    min-width: 80px;
}

.detail-label {
    color: #999;
}

.packing-header .back-btn {
    order: 4;
    margin-left: auto;
}

.packing-header .packing-header-title {
    order: 1;
    text-align: left;
}

.packing-header .color-legend {
    order: 2;
    margin-right: -8px;
}

.packing-header .header-filter {
    order: 3;
    margin-left: 0;
}

.record-completion-time {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.record-header .box-type-tag {
    margin-left: 8px;
    flex-shrink: 0;
}

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

.record-boxcode {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}

.record-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin-bottom: 6px;
}

.record-detail-item {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-detail-item .detail-label {
    color: #999;
}

.record-detail-single-row {
    grid-template-columns: 1fr 1.5fr 0.8fr;
    gap: 6px 8px;
}

.sidebar {
    display: none;
}

@media (min-width: 768px) {
    
    .app {
        display: flex;
        min-height: 100vh;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        width: 220px;
        background: linear-gradient(180deg, #1d2d3e 0%, #243746 100%);
        color: white;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 200;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 20px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .logo-icon {
        font-size: 24px;
    }

    .logo-img {
        height: 28px;
        width: auto;
        object-fit: contain;
    }

    .admin-logo-img {
        height: 24px;
        width: auto;
        object-fit: contain;
        vertical-align: middle;
        margin-right: 8px;
    }

    .logo-text {
        font-size: 16px;
        font-weight: 600;
    }

    .sidebar-nav {
        flex: 1;
        padding: 12px 0;
    }

    .sidebar-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        cursor: pointer;
        transition: all 0.2s;
        color: rgba(255,255,255,0.7);
        font-size: 14px;
        border-left: 3px solid transparent;
    }

    .sidebar-item:hover {
        background: rgba(255,255,255,0.08);
        color: white;
    }

    .sidebar-item.active {
        background: rgba(29,158,117,0.2);
        color: white;
        border-left-color: #0a6ed1;
    }

    .sidebar-icon {
        font-size: 18px;
        width: 24px;
        text-align: center;
    }

    .sidebar-label {
        flex: 1;
    }

    .sidebar-footer {
        padding: 16px 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .sidebar-admin-link {
        display: flex;
        align-items: center;
        gap: 8px;
        color: rgba(255,255,255,0.6);
        text-decoration: none;
        font-size: 13px;
        padding: 8px 0;
        transition: color 0.2s;
    }

    .sidebar-admin-link:hover {
        color: white;
    }

    .main-wrapper {
        flex: 1;
        margin-left: 220px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .header {
        padding: 16px 32px;
        background: white;
        color: #333;
        border-bottom: 1px solid #eee;
        box-shadow: none;
        text-align: left;
    }

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

    .content {
        flex: 1;
        padding: 24px 32px;
        padding-bottom: 32px;
        max-width: none;
        margin: 0;
    }

    .bottom-nav {
        display: none;
    }

    #page-packing .stats-row {
        flex: 1;
        gap: 12px;
        margin-bottom: 0;
        max-width: none;
    }

    #page-packing .scan-box-card {
        flex: 1;
        margin-bottom: 0;
        max-width: none;
    }

    #page-packing > div:first-child {
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
        align-items: stretch;
    }

    .stat-card {
        padding: 20px 14px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 13px;
    }

    .scan-box-card {
        padding: 22px 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .scan-input {
        font-size: 15px;
        padding: 14px 16px;
    }

    .btn-scan {
        padding: 14px 28px;
        font-size: 14px;
    }

    .query-form {
        padding: 22px 26px;
        margin-bottom: 20px;
    }

    .form-row {
        gap: 16px;
        margin-bottom: 14px;
    }

    .form-input, .dropdown-input {
        font-size: 14px;
        padding: 12px 14px;
    }

    .btn {
        font-size: 14px;
        padding: 12px 24px;
    }

    .btn-primary {
        padding: 12px 30px;
    }

    .packing-active {
        max-width: 700px;
        margin: 0 auto;
    }

    .packing-header {
        padding: 16px 22px;
        margin-bottom: 16px;
    }

    .packing-info {
        padding: 18px 22px;
        margin-bottom: 16px;
    }

    .progress-section, .scan-section, .scanned-list {
        padding: 18px 22px;
        margin-bottom: 16px;
    }

    .action-buttons {
        gap: 14px;
        margin-top: 20px;
    }

    .record-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 16px;
    }

    .record-card {
        padding: 18px 20px;
    }

    .query-result-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 14px;
    }

    .filter-bar {
        gap: 12px;
        margin-bottom: 20px;
    }

    .filter-bar input {
        flex: 1;
        padding: 7px 12px;
        font-size: 14px;
    }

    .filter-bar .btn {
        padding: 7px 14px;
        font-size: 14px;
    }

    .modal-content {
        max-width: 480px;
        padding: 24px;
    }

    .dropdown-list {
        max-height: 300px;
    }

    .dropdown-item {
        padding: 11px 16px;
        font-size: 14px;
    }
}

@media (min-width: 1200px) {
    .content {
        padding: 28px 40px;
    }

    .packing-active {
        max-width: 800px;
    }
}

.input-with-clear {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.input-with-clear .scan-input {
    width: 100%;
    padding-right: 36px;
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    font-size: 18px;
    color: #999;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    z-index: 10;
}

.clear-btn:hover {
    background: #e0e0e0;
    color: #666;
}

.clear-btn:active {
    background: #d0d0d0;
    transform: translateY(-50%) scale(0.9);
}

.dropdown-input-wrapper {
    position: relative;
    width: 100%;
}

.dropdown-input-wrapper .dropdown-input {
    width: 100%;
    box-sizing: border-box;
    transition: padding-right 0.2s;
}

.dropdown-input-wrapper.has-content .dropdown-input {
    background-image: none !important;
    padding-right: 36px !important;
}

.dropdown-input-wrapper:not(.has-content) .dropdown-input {
    padding-right: 32px !important;
}

.dropdown-input-wrapper .clear-btn {
    right: 6px;
    display: none !important;
}

.dropdown-input-wrapper.has-content .clear-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    
    body {
        font-size: 16px;
    }

    .header-title {
        font-size: 20px;
    }

    .form-title, .card-title, .list-title {
        font-size: 17px;
    }

    .scan-input, .dropdown-input, .form-input, input[type="text"], input[type="number"], select, textarea {
        font-size: 16px !important;
        padding: 14px 16px !important;
    }

    .btn {
        font-size: 16px !important;
        padding: 12px 20px !important;
    }

    .btn-sm {
        font-size: 14px !important;
        padding: 8px 14px !important;
    }

    .stat-card .stat-value {
        font-size: 24px;
    }

    .stat-card .stat-label {
        font-size: 14px;
    }

    .info-row .info-label {
        font-size: 14px;
    }

    .info-row .info-value {
        font-size: 16px;
    }

    .size-label, .size-count {
        font-size: 15px;
    }

    .scanned-item {
        font-size: 15px;
        padding: 12px 14px;
    }

    .result-card {
        font-size: 15px;
    }

    .result-card .card-title {
        font-size: 16px;
    }

    .record-card {
        font-size: 15px;
        padding: 16px;
    }

    .record-boxcode {
        font-size: 17px;
    }

    .record-status {
        font-size: 13px;
        padding: 4px 12px;
    }

    .record-detail {
        font-size: 14px;
        line-height: 2;
    }

    .record-detail span {
        margin-right: 16px;
    }

    .bottom-nav .nav-item {
        font-size: 12px;
    }

    .bottom-nav .nav-icon {
        font-size: 22px;
    }

    .scan-tip, .tip-text {
        font-size: 14px;
    }

    .modal-content {
        font-size: 16px;
    }

    .modal-title {
        font-size: 18px;
    }

    .tag, .badge {
        font-size: 13px;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 10px 8px;
    }

    .dropdown-item {
        font-size: 16px;
        padding: 12px 16px;
    }

    .clear-btn {
        width: 28px;
        height: 28px;
        line-height: 26px;
        font-size: 20px;
    }
}

@media (max-width: 479px) {
    body {
        font-size: 15px;
    }

    .header-title {
        font-size: 18px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .scan-input, .dropdown-input, .form-input {
        font-size: 15px !important;
        padding: 12px 14px !important;
    }

    .btn {
        font-size: 15px !important;
        padding: 11px 18px !important;
    }
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.detail-info-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    line-height: 1.6;
}

.detail-info-label {
    display: inline-block;
    min-width: 70px;
    color: #666;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .detail-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .detail-info-item {
        font-size: 15px;
        padding: 4px 0;
        border-bottom: 1px solid #f5f5f5;
    }

    .detail-info-label {
        min-width: 80px;
    }
}

.pending-style-card {
    background: linear-gradient(135deg, #fdf0ef 0%, #f9dcdb 100%);
    border: 1px solid #f0b4b3;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.pending-style-card:hover {
    background: linear-gradient(135deg, #f6d6d5 0%, #f0b4b3 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.pending-style-card:active {
    background: #e1f5ee;
    transform: translateY(0);
}

.pending-style-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pending-style-no {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.pending-total-boxes {
    font-size: 13px;
    color: #a32d2d;
    background: rgba(255,255,255,0.7);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.pending-style-detail {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

.pending-style-stats {
    display: flex;
    gap: 20px;
}

.pending-stat {
    font-size: 13px;
    color: #666;
}

.pending-stat strong {
    font-size: 16px;
    margin-left: 4px;
    font-weight: 600;
}

.pending-stat.packing strong {
    color: #ef9f27;
}

.pending-stat.unpacked strong {
    color: #a32d2d;
}

@media (max-width: 767px) {
    .pending-style-card {
        padding: 14px;
    }

    .pending-style-no {
        font-size: 16px;
    }

    .pending-total-boxes {
        font-size: 13px;
    }

    .pending-style-detail {
        font-size: 14px;
    }

    .pending-stat {
        font-size: 14px;
    }

    .pending-stat strong {
        font-size: 18px;
    }
}

.query-result-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

.query-result-header .header-left-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    min-width: 0 !important;
    order: 1 !important;
}

.query-result-header .packing-header-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.4 !important;
    order: 1 !important;
    display: block !important;
    width: 100% !important;
}

.query-result-header .header-second-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    order: 2 !important;
}

.query-result-header .back-btn {
    order: 2 !important;
    margin-left: 0 !important;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
    padding-top: 2px !important;
}

@media (max-width: 767px) {
    .query-result-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .query-result-header .header-left-content {
        gap: 6px;
    }

    .query-result-header .packing-header-title {
        font-size: 16px;
    }

    .query-result-header .header-second-row {
        gap: 8px;
    }

    .query-result-header .color-legend {
        gap: 8px;
    }

    .query-result-header .legend-item {
        font-size: 12px;
    }

    .query-result-header .filter-select {
        font-size: 12px;
        padding: 5px 10px;
    }

    .query-result-header .back-btn {
        font-size: 13px;
    }
}

.filter-tabs {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    width: 100% !important;
}

.filter-tab {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 13px !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    transition: all 0.2s !important;
    user-select: none !important;
    flex-shrink: 0 !important;
}

.filter-tab:hover {
    background: #f5f5f5;
}

.filter-tab.active {
    background: #e6f1fb;
    color: #0a6ed1;
    font-weight: 600;
}

.filter-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.filter-dot.filter-all {
    background: #333;
}

.filter-dot.filter-completed {
    background: #1d9e75;
    border: 1px solid #9fe1cb;
}

.filter-dot.filter-packing {
    background: #ef9f27;
    border: 1px solid #f2da9c;
}

.filter-dot.filter-unpacked {
    background: #e24b4a;
    border: 1px solid #f0b4b3;
}

@media (max-width: 767px) {
    .query-result-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .query-result-header .header-left-content {
        gap: 6px;
    }

    .query-result-header .packing-header-title {
        font-size: 16px;
    }

    .filter-tabs {
        gap: 8px;
    }

    .filter-tab {
        font-size: 12px;
        padding: 3px 6px;
        gap: 3px;
    }

    .filter-dot {
        width: 10px;
        height: 10px;
    }

    .query-result-header .back-btn {
        font-size: 13px;
    }
}

.packing-progress-bar {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.progress-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.progress-text {
    font-size: 12px;
    color: #333;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0a6ed1 0%, #085caf 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}

@media (max-width: 767px) {
    .packing-progress-bar {
        margin-top: 8px;
        padding-top: 8px;
    }

    .progress-label,
    .progress-text {
        font-size: 11px;
    }

    .progress-track {
        height: 6px;
    }
}

.pull-refresh {
    display: none !important;
}

.double-tap-input[readonly] {
    cursor: pointer;
    background-color: #f0f6fd;
    user-select: none;
    -webkit-user-select: none;
}

.double-tap-input[readonly]:focus {
    outline: none;
    border-color: #0a6ed1;
    background-color: #e6f1fb;
}

.double-tap-input:not([readonly]) {
    background-color: #fff;
    cursor: text;
}

.input-editing-tip {
    position: absolute;
    top: -20px;
    right: 5px;
    font-size: 10px;
    color: #0a6ed1;
    background: #e6f1fb;
    padding: 2px 6px;
    border-radius: 3px;
    display: none;
}

.input-editing-tip.show {
    display: block;
}

.app-footer {
    display: none;
    text-align: center;
    padding: 10px 15px 15px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.app-footer .footer-copyright {
    font-size: 11px;
    color: #999;
    line-height: 1.5;
}

.app-footer .footer-version {
    font-size: 10px;
    color: #bbb;
    margin-top: 2px;
}

@media (max-width: 767px) {
    .app-footer {
        display: block;
    }
}

@media (max-width: 767px) {
    
    .query-result-item .result-boxcode {
        font-size: 16px !important;
    }
    .query-result-item .result-boxno {
        font-size: 14px !important;
    }
    .query-result-item .result-detail {
        font-size: 14px !important;
        line-height: 2 !important;
    }
    .query-result-item .field-value {
        font-size: 14px !important;
    }

    .record-card .record-boxcode {
        font-size: 18px !important;
    }
    .record-card .record-completion-time {
        font-size: 13px !important;
    }
    .record-card .record-detail {
        font-size: 15px !important;
        line-height: 2 !important;
    }
    .record-card .record-detail-item {
        font-size: 15px !important;
    }
    .record-card .detail-label {
        font-size: 14px !important;
    }
    .record-card .field-value {
        font-size: 15px !important;
    }

    .modal-result-list .query-result-item .result-boxcode {
        font-size: 16px !important;
    }
    .modal-result-list .query-result-item .result-detail {
        font-size: 14px !important;
    }

    .packing-progress-bar .progress-label,
    .packing-progress-bar .progress-text {
        font-size: 13px !important;
    }
}

.header-title-wrapper {
    display: flex;
    align-items: flex-end;
    flex: 1;
    gap: 8px;
}

.header-title-wrapper .header-title {
    flex: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.header-version {
    font-size: 9px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    padding-bottom: 1px;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .header-title-wrapper .header-title {
        font-size: 18px;
    }
    .header-version {
        font-size: 9px;
    }
}
