:root {
    --primary: #4A90D9;
    --danger: #E74C3C;
    --success: #27AE60;
    --error: #E74C3C;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text); min-height:100vh;
    padding-bottom: 40px; -webkit-tap-highlight-color: transparent;
}
.header {
    background: var(--primary); color: #fff; padding: 10px 16px;
    text-align: center; font-size: 17px; font-weight: 600;
    position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.container { max-width: 500px; margin:0 auto; padding:8px 12px; }
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
}
.toast-show {
    animation: toastIn 2.35s ease forwards, toastOut 2.35s ease 2.5s forwards;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--error); color: #fff; }
@keyframes toastIn {
    from { opacity: 1; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
.card {
    background: var(--card-bg); border-radius: 12px; padding: 12px 14px;
    margin-bottom: 10px; box-shadow: var(--shadow);
}
.card h3 { font-size:14px; margin-bottom:8px; display:flex; align-items:center; gap:6px; }
details.card { padding: 0; overflow: hidden; }
details.card summary {
    display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600;
    padding: 12px 14px; cursor: pointer; list-style: none; user-select: none;
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary::before {
    content: '▶'; display: inline-block; margin-right: -1px;
    transition: transform 0.2s; font-size: 10px; color: var(--text-light);
}
details.card[open] summary::before { transform: rotate(90deg); }
details.card .details-content { padding: 0 14px 12px 14px; }
.product-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.product-item {
    background: #f8fafc; border:1px solid var(--border); border-radius:10px;
    padding:8px; text-align:center; cursor:pointer; user-select:none;
    transition: all 0.15s; position: relative;
}
.product-item:active { background:#e8f0fe; border-color:var(--primary); transform:scale(0.97); }
.product-item .p-name { font-weight:600; font-size:13px; margin-bottom:2px; }
.product-item .p-spec { font-size:10px; color: var(--text-light); margin-bottom:3px; }
.product-item .p-price { color:var(--danger); font-weight:700; font-size:15px; }
.btn {
    display:inline-block; padding:7px 14px; border:none; border-radius:8px;
    font-size:13px; font-weight:500; cursor:pointer; transition:0.15s;
}
.btn:active { transform:scale(0.95); }
.btn-primary { background:var(--primary); color:#fff; }
.btn-danger { background:var(--danger); color:#fff; }
.btn-sm { padding:4px 8px; font-size:11px; border-radius:6px; }
.btn-outline { background:#fff; border:1px solid var(--primary); color:var(--primary); }
.btn-block { display:block; width:100%; padding:11px; font-size:15px; font-weight:600; border-radius:10px; }
.cart-item {
    display:flex; align-items:center; justify-content:space-between;
    padding:7px 0; border-bottom:1px solid #f0f0f0; gap:6px; flex-wrap:wrap;
}
.cart-item:last-child { border-bottom:none; }
.cart-item .item-info { flex:1; min-width:80px; }
.cart-item .item-name { font-weight:500; font-size:14px; }
.cart-item .item-spec { font-size:10px; color: var(--text-light); }
.cart-item .item-price-row { display:flex; align-items:center; gap:4px; font-size:11px; margin-top:2px; }
.cart-item .item-price-row input {
    width:65px; padding:2px 4px; border:1px solid var(--border);
    border-radius:4px; font-size:11px; text-align:center; color:var(--danger); font-weight:600;
    -webkit-appearance:none;/*65为单价输入框宽度*/
}
.cart-item .item-subtotal { font-weight:700; color:var(--danger); font-size:13px; white-space:nowrap; }
.qty-control { display:flex; align-items:center; gap:3px; }
.qty-control input {
    width:32px; text-align:center; border:1px solid var(--border);
    border-radius:5px; padding:2px; font-size:12px; -webkit-appearance:none;
}
.qty-control button {
    width:22px; height:22px; border-radius:50%; border:1px solid var(--border);
    background:#fff; font-size:12px; cursor:pointer; display:flex;
    align-items:center; justify-content:center; padding:0;
}
.cart-total {
    text-align:right; font-size:18px; font-weight:700; color:var(--danger);
    padding-top:7px; margin-top:4px; border-top:2px dashed var(--border);
}
.empty-cart { text-align:center; color:var(--text-light); padding:16px; font-size:13px; }
.custom-form { display:flex; gap:5px; flex-wrap:wrap; }
.custom-form input {
    flex:1; min-width:70px; padding:7px 8px; border:1px solid var(--border);
    border-radius:8px; font-size:12px; -webkit-appearance:none;
}
.custom-form input:focus { outline:none; border-color:var(--primary); }
.customer-input {
    width: 100%; padding: 7px 10px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 13px;
}
.customer-item {
    background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
    padding: 8px; cursor: pointer; user-select: none; transition: all 0.15s;
    position: relative;
}
.customer-item:active { background: #e8f0fe; border-color: var(--primary); transform: scale(0.97); }
.customer-item .c-name { font-weight: 600; font-size: 13px; }
.customer-item .c-time { font-size: 10px; color: var(--text-light); margin-top: 2px; }
 
/* 通用删除按钮（客户/商品共用） */
.customer-item .delete-customer-btn,
.product-entry .delete-customer-btn {
    position: absolute; top: -5px; right: -3px; font-size: 12px; color: #ccc;
    cursor: pointer; z-index: 2; background: none; border: none; padding: 2px; line-height: 1;
}
.customer-item .delete-customer-btn:hover,
.product-entry .delete-customer-btn:hover { color: var(--danger); }

/* 编辑按钮（紧挨删除按钮左侧） */
.customer-item .edit-btn,
.product-entry .edit-btn {
    position: absolute; top: -3px; right: 16px; font-size: 12px; color: #ccc;
    cursor: pointer; z-index: 2; background: none; border: none; padding: 2px; line-height: 1;
}
.customer-item .edit-btn:hover,
.product-entry .edit-btn:hover { color: var(--primary); }
 
.history-order-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 6px;
    background: #fafbfc;
    overflow: hidden;
}
.history-order-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    gap: 8px;
}
.history-order-item summary::-webkit-details-marker { display: none; }
.history-order-item summary .ho-left { flex: 1; min-width: 0; }
.history-order-item summary .ho-left .ho-no {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}
.history-order-item summary .ho-left .ho-meta {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 1px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.history-order-item summary .ho-right { text-align: right; flex-shrink: 0; }
.history-order-item summary .ho-right .ho-total {
    font-weight: 700;
    font-size: 15px;
    color: var(--danger);
}
.history-order-item summary .ho-right .ho-count {
    font-size: 10px;
    color: var(--text-light);
}
.history-order-item summary::after {
    content: '▶';
    font-size: 9px;
    color: var(--text-light);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.history-order-item[open] summary::after { transform: rotate(90deg); }
.history-order-item .ho-detail {
    padding: 0 10px 10px 10px;
    border-top: 1px dashed #e8e8e8;
    margin-top: 3px;
    padding-top: 8px;
}
.history-order-item .ho-detail .ho-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    border-bottom: 1px dotted #f0f0f0;
}
.history-order-item .ho-detail .ho-line:last-child { border-bottom: none; }
.history-order-item .ho-detail .ho-line .ho-item-name { flex: 1; min-width: 0; }
.history-order-item .ho-detail .ho-line .ho-item-subtotal {
    font-weight: 600;
    color: var(--danger);
    white-space: nowrap;
    margin-left: 6px;
}
.history-order-item .ho-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}
.footer {/*下面的-10调节上下*/
    max-width: 500px; margin: -10px auto 20px; padding: 0 12px;
    text-align: center; font-size: 12px; color: var(--text-light);
}
.footer a {
    color: var(--text-light); text-decoration: none; cursor: pointer; margin: 0 10px;
}
.footer a:hover { color: var(--primary); }
.footer .divider { color: #ddd; }
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff; border-radius: 12px; width: 90%; max-width: 400px;
    max-height: 75vh; overflow-y: auto; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal h4 { margin-bottom: 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.modal .close-btn {
    float: right; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light);    margin-top: -5px;   /* ← 新增，叉号上移 */
    margin-right: -5px; /* ← 新增，叉号右移 */
}
.modal .customer-summary {
    background: #f0f7ff; padding: 10px; border-radius: 8px; margin-bottom: 12px;
    text-align: center; font-weight: 600;
}
.modal .load-order-btn {
    margin-top: 6px; font-size: 12px; padding: 4px 10px;
    background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer;
}
.modal button.reopen-btn.btn-sm {
    padding: 2px 4px;/*重新开单四个字边距*/
    margin-left: -4px;/*重新开单四个字距离左侧距离*/
	margin-right: 5px;   /* ← 新增 重新开单与右侧叉号间距*/
    font-size: 12px;
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.filter-row select {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
}
.search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
}
.search-input:focus { border-color: var(--primary); }
.screenshot-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.99); z-index: 300; align-items: center; justify-content: center;
}
.screenshot-overlay.active { display: flex; }
.screenshot-card {
    background: #fff; width: 92%; max-width: 420px;
    border-radius: 12px; padding: 20px 18px 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}
.screenshot-card .s-header {
    text-align: center; border-bottom: 1px solid #e8e8e8;
    padding-bottom: 12px; margin-bottom: 12px;
}
.screenshot-card .s-header .s-title { font-size: 18px; font-weight: 700; color: #2c3e50; }
.screenshot-card .s-header .s-meta { font-size: 12px; color: #999; margin-top: 4px; }
.screenshot-card .s-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 6px 0; border-bottom: 1px dotted #f0f0f0; font-size: 14px;
}
.screenshot-card .s-row:last-child { border-bottom: none; }
.screenshot-card .s-row .s-left { flex: 1; }
/* 截图弹窗中的单价与规格共同行 */
.s-price-info { font-size: 12px;color: #999; margin-top: 2px; /* 与 s-spec 颜色一致 */  }
.screenshot-card .s-row .s-right { 
    text-align: right; font-weight: 600; color: var(--danger);
    white-space: nowrap; margin-left: 8px;
}
.screenshot-card .s-divider { border-top: 2px dashed #e0e0e0; margin: 8px 0; }
.screenshot-card .s-total {
    text-align: right; font-size: 20px; font-weight: 700; color: var(--danger);
    padding-top: 6px;
}
.screenshot-card .s-total .s-total-label { font-size: 13px; color: #666; }
.screenshot-card .s-footer { text-align: center; font-size: 11px; color: #bbb; margin-top: 10px; }


.screenshot-card .s-close-btn {
    display: block; margin: 14px auto 0; padding: 5px 20px;
    background: #fff; border: 1px solid #ccc; border-radius: 6px;
    font-size: 11px; cursor: pointer; color: #666;/* 截图的关闭二字大小 */
}
 
/* 登录页 */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: 0;
}
.login-card {
    background: #fff; border-radius: 16px; padding: 32px 24px;
    width: 90%; max-width: 360px; box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    text-align: center;
}
.login-card h2 { margin-bottom: 8px; color: #2c3e50; }
.login-card p { color: #7f8c8d; font-size: 14px; margin-bottom: 20px; }
.login-card input {
    width: 100%; padding: 12px; border: 1px solid #e0e0e0;
    border-radius: 10px; font-size: 16px; text-align: center;
    margin-bottom: 12px; outline: none;
}
.login-card input:focus { border-color: #4A90D9; }
.login-card button {
    width: 100%; padding: 12px; background: #4A90D9; color: #fff;
    border: none; border-radius: 10px; font-size: 16px; cursor: pointer;
    font-weight: 600;
}
/* 登录按钮悬停及点击反馈 */
.login-card button:hover {
    background: #3a7bc8;        /* 稍深的蓝色 */
}
.login-card button:active {
    transform: scale(0.97);     /* 按下时微微缩小 */
    background: #2f6ea3;        /* 更深的蓝色 */
}

/* 免密登录按钮 */
.login-card .guest-login-btn {
    width: 100%;
    padding: 10px;
    background: #7f8c8d;       /* 灰蓝色，低调 */
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
/* 免登录按钮悬停及点击反馈 */
.login-card .guest-login-btn:hover {
    background: #6c7a7a;
}
.login-card .guest-login-btn:active {
    transform: scale(0.97);
}

.login-card .error { color: #E74C3C; font-size: 14px; margin-bottom: 8px; }
 
.hidden-order { display: none; }
.hidden-customer { display: none; }
.hidden-product { display: none; }
 
/* 恢复弹窗文件选择按钮增强 */
.modal input[type="file"] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    cursor: pointer;
}
/* 电脑端统一优化此处其他未变20260703完全可以删除 */
@media screen and (min-width: 768px) {
    /* 布局优化 */
    .container { max-width: 800px; margin: 0 auto; }
    .card { max-width: 100%; }
    .product-grid, .customer-grid { 
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
        gap: 10px; 
    }
    
    /* 交互优化 */
    .btn { padding: 10px 20px; font-size: 14px; }
    .card h3 { font-size: 16px; }
}
/* 电脑端统一优化此处其他未变20260703完全可以删除 */