/* ============================================
   餐饮店管理系统 - 主样式表
   纯 CSS · 移动端自适应 · 简约大气
   ============================================ */

/* ===== CSS 变量 ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #ca8a04;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0891b2;
    --info-light: #cffafe;

    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.08);

    --sidebar-w: 230px;
    --topbar-h: 56px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ===== 布局 ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; z-index: 100; box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 17px; font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-info { display: flex; align-items: center; gap: 6px; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 20px; }
.btn-logout { color: var(--danger); font-size: 13px; }

/* 侧边栏 */
.sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: var(--sidebar-w);
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 16px 0; overflow-y: auto; z-index: 90;
    transition: transform .25s ease;
}
.sidebar-logo { padding: 8px 20px 20px; font-size: 16px; font-weight: 700; color: var(--primary); }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 500;
    transition: all .15s;
}
.nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-section-title { padding: 16px 14px 6px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* 主内容区 */
.main-content { margin-left: var(--sidebar-w); margin-top: var(--topbar-h); padding: 20px; min-height: calc(100vh - var(--topbar-h)); }

/* 底部导航 (移动端) */
.bottom-nav { display: none; }

/* ===== 卡片 ===== */
.card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; margin-bottom: 16px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; }
.card-body { }
.card-actions { display: flex; gap: 8px; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; display: flex; align-items: center; gap: 16px;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-label .req { color: var(--danger); }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row > .form-group { flex: 1; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer;
    font-weight: 600; font-size: 14px; transition: all .15s; white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 14px; }
th { background: var(--bg); font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
tbody tr:hover { background: var(--bg); }
td .btn-group { gap: 4px; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 40px; }

/* ===== 徽章 ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: #f1f5f9; color: var(--text-secondary); }

/* ===== 分页 ===== */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.pagination a { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a.disabled { opacity: .4; pointer-events: none; }
.pagination .page-info { margin-left: auto; font-size: 13px; color: var(--text-muted); }

/* ===== Toast ===== */
.toast {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    z-index: 9999; font-weight: 500; animation: slideDown .3s ease;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }
.toast-info { background: var(--info); color: #fff; }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 页面标题 ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 20px; font-weight: 700; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 搜索/筛选栏 ===== */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar .form-input, .filter-bar .form-select { width: auto; min-width: 140px; }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200;
    display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-wide { max-width: 880px; }
.img-preview-list { display: flex; flex-direction: column; gap: 20px; align-items: center; max-height: 60vh; overflow-y: auto; padding: 4px; }
.img-preview-page { width: 100%; max-width: 680px; text-align: center; }
.img-preview-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.img-preview-page img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-lg { font-size: 16px; }
.font-sm { font-size: 13px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.w-100 { width: 100%; }

/* ===== 详情页 ===== */
.detail-list { display: flex; flex-direction: column; gap: 0; }
.detail-item { display: flex; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.detail-label { width: 120px; color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.detail-value { flex: 1; }

/* ===== 任务/订单列表项 ===== */
.list-item {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px; margin-bottom: 12px; transition: box-shadow .15s;
}
.list-item:hover { box-shadow: var(--shadow-md); }
.list-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.list-item-title { font-weight: 600; font-size: 15px; }
.list-item-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* ===== 回复/评论时间线 ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.timeline-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.timeline-author { font-weight: 600; font-size: 14px; }
.timeline-time { font-size: 12px; color: var(--text-muted); }
.timeline-content { font-size: 14px; color: var(--text); background: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); }

/* ===== 订单产品选择器 ===== */
.product-picker { display: flex; flex-direction: column; gap: 8px; }
.product-row {
    display: flex; align-items: center; gap: 8px; padding: 10px;
    background: var(--bg); border-radius: var(--radius-sm);
}
.product-row select { flex: 1; }
.product-row .qty-input { width: 70px; text-align: center; }
.product-row .subtotal { min-width: 80px; text-align: right; font-weight: 600; }
.product-row .btn-remove { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px; }
.order-total { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 0; border-top: 2px solid var(--border); margin-top: 12px; }
.order-total-amount { font-size: 20px; font-weight: 700; color: var(--primary); }

/* ===== 附件 ===== */
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.attachment-icon { font-size: 20px; }

/* ===== 上传区域 ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--bg);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light, #eef6ff); }
.upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light, #eef6ff); }
.upload-zone-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.upload-icon { font-size: 32px; }
.upload-text { font-size: 14px; font-weight: 600; color: var(--text); }
.upload-hint { font-size: 12px; color: var(--text-muted); }

/* ===== 文件列表 ===== */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.file-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; background: var(--card); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); transition: border-color .15s;
}
.file-item:hover { border-color: var(--primary); }
.file-thumb {
    width: 40px; height: 40px; border-radius: var(--radius-sm); overflow: hidden;
    background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 1px solid var(--border-light);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb-doc { background: var(--primary-light, #eef6ff); }
.file-ext-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: var(--primary); line-height: 1;
}
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.file-remove {
    width: 24px; height: 24px; border: none; background: var(--bg); border-radius: 50%;
    cursor: pointer; font-size: 16px; line-height: 1; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background .15s, color .15s;
}
.file-remove:hover { background: #fee; color: var(--danger); }

/* ===== 附件图片缩略图 ===== */
.attachment-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.attachment-thumb {
    display: block; aspect-ratio: 1; overflow: hidden;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg); transition: all .15s;
}
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-thumb:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* 门店选择列表 */
.store-picker { display: flex; flex-direction: column; gap: 8px; }
.store-pick-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: var(--bg); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text); transition: all .15s;
    border: 1px solid transparent;
}
.store-pick-item:hover { background: var(--primary-light); border-color: var(--primary); text-decoration: none; }
.store-pick-name { font-weight: 600; font-size: 15px; }
.store-pick-arrow { font-size: 20px; color: var(--text-muted); }

/* ===== 勾选组件 ===== */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
    font-size: 14px; user-select: none;
}
.checkbox-item:hover { border-color: var(--primary); background: var(--primary-light, #eef6ff); }
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; margin: 0; accent-color: var(--primary); }
.checkbox-item.checked { border-color: var(--primary); background: var(--primary-light, #eef6ff); color: var(--primary); font-weight: 600; }
.checkbox-select-all {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; background: transparent; border: 1px dashed var(--border);
    border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
    font-size: 13px; color: var(--text-secondary); user-select: none;
}
.checkbox-select-all:hover { border-color: var(--primary); color: var(--primary); }
.checkbox-select-all input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; margin: 0; accent-color: var(--primary); }
.recipient-group { margin-bottom: 12px; }
.recipient-group-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
    font-weight: 600; font-size: 14px; color: var(--text);
}
.recipient-group-body { padding-left: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.recipient-summary {
    margin-top: 8px; padding: 8px 12px; background: var(--bg);
    border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary);
}
.recipient-summary span { margin-right: 12px; }
.recipient-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.recipient-tag {
    display: inline-block; padding: 2px 10px; background: var(--primary-light, #eef6ff);
    color: var(--primary); border-radius: 12px; font-size: 12px; font-weight: 500;
}

/* ===== 简易柱状图 ===== */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 16px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 70%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px; transition: height .3s; position: relative; }
.bar:hover { background: var(--primary-dark); }
.bar-value { font-size: 12px; font-weight: 600; color: var(--text); position: absolute; top: -20px; }
.bar-label { font-size: 12px; color: var(--text-secondary); }

/* ===== 响应式: 平板 ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ===== 响应式: 移动端 ===== */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .topbar { padding: 0 12px; }
    .topbar-title { font-size: 15px; }
    .menu-toggle { display: block; }
    .user-info .user-name { display: none; }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.show { transform: translateX(0); }

    .main-content { margin-left: 0; padding: 12px; padding-bottom: 72px; }

    /* 底部导航 */
    .bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--surface); border-top: 1px solid var(--border);
        z-index: 100; box-shadow: 0 -1px 4px rgba(0,0,0,.06);
    }
    .bottom-nav-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 8px 0; color: var(--text-muted); font-size: 11px; text-decoration: none;
        transition: color .15s;
    }
    .bottom-nav-item.active { color: var(--primary); }
    .bottom-nav-item svg { width: 22px; height: 22px; }
    .bottom-nav-item:hover { text-decoration: none; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { width: 40px; height: 40px; }
    .stat-value { font-size: 18px; }

    .form-row { flex-direction: column; gap: 0; }

    .page-header h2 { font-size: 17px; }
    .card { padding: 14px; }

    th, td { padding: 8px 10px; font-size: 13px; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-input, .filter-bar .form-select { width: 100%; }

    .modal { padding: 16px; border-radius: 12px; }

    .product-row { flex-wrap: wrap; }
    .product-row select { width: 100%; }

    .detail-label { width: 90px; }

    .bar-chart { height: 140px; gap: 4px; }

    /* ===== 响应式表格 → 卡片布局 ===== */
    .table-wrap { overflow-x: visible; }
    .table-wrap table thead { display: none; }
    .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
    .table-wrap tbody tr {
        display: block;
        background: var(--surface);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 12px 14px;
        margin-bottom: 10px;
        border: none;
    }
    .table-wrap tbody tr:hover { background: var(--surface); }
    .table-wrap tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid var(--border-light);
        padding: 7px 0;
        font-size: 14px;
    }
    .table-wrap tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
        padding-right: 12px;
        flex-shrink: 0;
    }
    .table-wrap tbody td:last-child {
        border-bottom: none;
        padding-top: 10px;
        justify-content: flex-end;
    }
    .table-wrap tbody td:last-child::before { display: none; }
    .table-wrap tbody td:last-child .btn-group {
        justify-content: flex-end;
    }
    .table-wrap tbody td:last-child .btn-group .btn { padding: 4px 10px; font-size: 12px; }
    .table-wrap tbody tr.empty-row td {
        display: block;
        text-align: center;
        padding: 40px 0;
    }
    .table-wrap tbody tr.empty-row td::before { display: none; }

    /* ===== 订单详情产品明细 - 紧凑单行布局 ===== */
    .order-items-table tbody tr {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0 4px;
        padding: 10px 12px;
        margin-bottom: 8px;
        border-radius: var(--radius-sm);
        background: var(--surface);
        box-shadow: var(--shadow);
        border: none;
    }
    .order-items-table tbody tr:hover { background: var(--surface); }
    .order-items-table tbody td {
        display: inline;
        border-bottom: none;
        padding: 0;
        font-size: 14px;
        text-align: left;
    }
    .order-items-table tbody td::before { display: none; }
    /* 产品名称 - 独占第一行左侧 */
    .order-items-table tbody td:nth-child(1) {
        width: 100%;
        font-weight: 700;
        font-size: 15px;
        padding-right: 70px;
    }
    /* 小计 - 第一行右侧绝对定位 */
    .order-items-table tbody td:nth-child(6) {
        position: absolute;
        right: 12px;
        top: 10px;
        font-weight: 700;
        color: var(--danger);
        font-size: 15px;
    }
    /* 规格/单位/单价/数量 - 第二行紧凑排列 */
    .order-items-table tbody td:nth-child(2),
    .order-items-table tbody td:nth-child(3),
    .order-items-table tbody td:nth-child(4),
    .order-items-table tbody td:nth-child(5) {
        color: var(--text-secondary);
        font-size: 13px;
    }
    .order-items-table tbody td:nth-child(2)::after { content: ' · '; color: var(--text-muted); }
    .order-items-table tbody td:nth-child(3)::after { content: ' · '; color: var(--text-muted); }
    .order-items-table tbody td:nth-child(4)::after { content: ' × '; color: var(--text-muted); }
    /* tfoot 总计行 */
    .order-items-table tfoot { display: block; width: 100%; margin-top: 4px; }
    .order-items-table tfoot tr {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 4px;
        padding: 12px;
        background: var(--bg);
        border-radius: var(--radius-sm);
    }
    .order-items-table tfoot td { display: inline; border: none; padding: 0; }
    .order-items-table tfoot td:first-child::after { content: '：'; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .btn-group { flex-direction: column; width: 100%; }
    .btn-group .btn { width: 100%; }
    .attachment-images { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}
