/* ============================================
   艺术品物流系统 - 全局样式 v2.0
   ============================================ */

:root {
    --sidebar-bg: #1a2332;
    --sidebar-active: #c9a961;
    --sidebar-text: #a0aec0;
    --sidebar-text-hover: #ffffff;
    --content-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --border-color: #e2e8f0;
    --accent: #c9a961;
    --accent-dark: #b8975a;
    --primary: #3182ce;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --sidebar-width: 160px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #f6f8fb 0%, #eef1f6 100%);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === 布局 === */
.layout { display: flex; min-height: 100vh; }

/* === 侧边栏 === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

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

.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #fff; flex-shrink: 0;
}

.sidebar-logo .logo-text { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar-logo .logo-text span { font-size: 9px; font-weight: 400; color: var(--sidebar-text); }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; overscroll-behavior: contain;
    /* Firefox：细滚动条 + 隐藏式配色 */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}

/* === 隐藏式滚动条（上下移动条）：默认隐藏，悬停侧边栏时浮现 === */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: transparent;          /* 平时隐藏 */
    border-radius: 4px;
    transition: background 0.2s ease;
}
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb,
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); }
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb:hover,
.sidebar-nav:hover::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }

.sidebar-nav .nav-section {
    padding: 16px 20px 6px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
}

.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover { color: var(--sidebar-text-hover); background: rgba(255,255,255,0.04); text-decoration: none; }
.sidebar-nav a.active { color: var(--sidebar-active); background: rgba(201,169,97,0.08); border-left-color: var(--sidebar-active); }
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav-label { display: flex; flex-direction: column; line-height: 1.35; }
.nav-zh { font-size: 14px; }
.nav-en { font-size: 10px; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-nav a.active .nav-en { opacity: 0.85; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: rgba(255,255,255,0.3); }

/* === 移动端遮罩 === */
.sidebar-overlay { display: none; }

/* === 主内容区 === */
.main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--card-bg);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar .user-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.topbar .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}

/* === 移动端菜单按钮 === */
.menu-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: 6px; border-radius: 6px;
    color: var(--text-primary);
}
.menu-toggle svg { width: 24px; height: 24px; }
.menu-toggle:hover { background: #f7fafc; }

.content { padding: 28px; flex: 1; }

/* === 仪表盘页头（质感增强） === */
.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.dashboard-head .dh-title { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; line-height: 1.2; }
.dashboard-head .dh-sub { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.dashboard-head .dh-date {
    font-size: 13px; color: var(--text-secondary); white-space: nowrap;
    background: #fff; border: 1px solid var(--border-color); padding: 8px 16px;
    border-radius: 999px; box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 4px 12px rgba(16,24,40,0.04);
    display: inline-flex; align-items: center; gap: 8px;
}
.dashboard-head .dh-date::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

/* === 统计卡片（质感增强） === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 28px; }

.stat-card {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid rgba(226,232,240,0.85);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 6px 18px rgba(16,24,40,0.05);
    transition: transform .28s cubic-bezier(.21,1.02,.73,1), box-shadow .28s, border-color .28s;
}
/* 左侧彩色渐变装饰条 */
.stat-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, var(--bar, var(--accent)), transparent);
    opacity: .95; transition: width .25s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(16,24,40,0.10), 0 3px 8px rgba(16,24,40,0.06);
    border-color: var(--bar-soft, rgba(201,169,97,0.35));
}
.stat-card:hover::before { width: 5px; }

.stat-card.c-blue   { --bar: #3182ce; --bar-soft: rgba(49,130,206,0.22); }
.stat-card.c-amber  { --bar: #d69e2e; --bar-soft: rgba(214,158,46,0.22); }
.stat-card.c-green  { --bar: #38a169; --bar-soft: rgba(56,161,105,0.22); }
.stat-card.c-purple { --bar: #805ad5; --bar-soft: rgba(128,90,213,0.22); }

.stat-card .stat-icon {
    width: 54px; height: 54px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 14px var(--bar-soft, rgba(16,24,40,0.08));
}
.stat-card .stat-icon svg { width: 24px; height: 24px; }

.stat-icon.bg-blue   { background: linear-gradient(140deg, #eaf4ff, #d6e9ff); color: #3182ce; }
.stat-icon.bg-green  { background: linear-gradient(140deg, #e7faf2, #d2f3e6); color: #38a169; }
.stat-icon.bg-amber  { background: linear-gradient(140deg, #fff6e0, #ffe9b8); color: #d69e2e; }
.stat-icon.bg-purple { background: linear-gradient(140deg, #f3ecff, #e6d9ff); color: #805ad5; }

.stat-card .stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-card .stat-info h3 { font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1.1; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat-card .stat-info p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 7px; display: inline-flex; align-items: center; gap: 5px; }
.stat-sub::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--bar, var(--accent)); opacity: .7; }

/* === 卡片容器 === */
.card {
    background: var(--card-bg);
    border: 1px solid rgba(226,232,240,0.85);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 6px 18px rgba(16,24,40,0.05);
    margin-bottom: 24px; overflow: hidden;
    transition: box-shadow .25s, border-color .25s;
}
.card:hover { box-shadow: 0 10px 26px rgba(16,24,40,0.08); }
.card-header {
    padding: 18px 24px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(180deg, #fcfdff 0%, #f7f9fc 100%);
}
.card-header h2 {
    font-size: 16px; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 10px;
}
.card-header h2::before {
    content: ''; width: 4px; height: 16px; border-radius: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
}
.card-body { padding: 24px; }

/* === 表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

table thead th {
    background: linear-gradient(180deg, #fbfcfe, #f4f6f9);
    padding: 13px 16px;
    text-align: left; font-weight: 600; color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color); white-space: nowrap;
}
table thead th .th-zh { display: block; font-size: 13px; }
table thead th .th-en { display: block; font-size: 10px; opacity: 0.55; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 400; }

table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
table tbody tr { transition: background .18s ease; }
table tbody tr:hover { background: #f7fafc; }
table tbody tr:last-child td { border-bottom: none; }

/* === 状态标签 === */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: #e6fffa; color: #38a169; }
.badge-blue  { background: #ebf5ff; color: #3182ce; }
.badge-amber { background: #fffbeb; color: #d69e2e; }
.badge-red   { background: #fff5f5; color: #e53e3e; }
.badge-gray  { background: #f7fafc; color: #718096; }
.badge-purple { background: #f3e8ff; color: #805ad5; }
.badge-teal   { background: #e6fffa; color: #319795; }

/* === 按钮 === */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; border: none; cursor: pointer;
    transition: all 0.2s; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-blue { background: var(--primary); color: #fff; }
.btn-blue:hover { background: #2c6cb0; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-outline:hover { background: #f7fafc; border-color: #cbd5e0; }
.btn-danger { background: #f7fafc; color: #718096; border: 1px solid #e2e8f0; }
.btn-danger:hover { background: #edf2f7; border-color: #cbd5e0; color: #4a5568; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* === 表单 === */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.form-group label .required { color: var(--danger); }

.form-control {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text-primary); background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,169,97,0.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
select.form-control option { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-color); }

/* === 图片上传（艺术品） === */
.image-upload-wrap {
    width: 100%; min-height: 160px;
    border: 2px dashed var(--border-color); border-radius: var(--radius-md);
    background: #fafbfc; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; overflow: hidden; position: relative;
}
.image-upload-wrap:hover { border-color: var(--accent); background: #fffaf0; }
.image-upload-wrap.has-image { border-style: solid; border-color: var(--accent); background: #fff; }
.image-upload-wrap.remove-current { opacity: 0.5; }

.image-upload-placeholder { text-align: center; color: var(--text-muted); pointer-events: none; padding: 24px; }
.image-upload-placeholder svg { width: 44px; height: 44px; margin-bottom: 10px; color: var(--accent); }
.image-upload-placeholder p { font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.image-upload-placeholder span { font-size: 12px; }
.image-preview { max-width: 100%; max-height: 240px; object-fit: contain; padding: 12px; }

.current-image { margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.current-image img { max-width: 160px; max-height: 120px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); object-fit: cover; background: #fafbfc; padding: 4px; }
.remove-image-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--danger); cursor: pointer; user-select: none; }
.remove-image-label input { cursor: pointer; }

.artwork-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: #fafbfc; display: block; }
.artwork-thumb.empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted); background: #f7fafc; }

/* === 拍照上传区域（物流/签单通用） === */
.photo-upload-area {
    width: 100%; min-height: 160px;
    border: 2px dashed var(--border-color); border-radius: var(--radius-md);
    background: #fafbfc; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; overflow: hidden; position: relative;
}
.photo-upload-area:hover { border-color: var(--accent); background: #fffaf0; }
.photo-upload-area.has-photo {
    border-style: solid; border-color: var(--accent);
    background: #fff; padding: 0; min-height: auto;
}
.photo-upload-area.has-photo .photo-upload-placeholder { display: none; }
.photo-upload-area .photo-preview-img {
    display: none;
    width: 100%; max-height: 320px; object-fit: contain;
    border-radius: var(--radius-md);
}
.photo-upload-area.has-photo .photo-preview-img { display: block; }

.photo-upload-placeholder { text-align: center; color: var(--text-muted); padding: 24px; cursor: pointer; }
.photo-upload-placeholder svg { width: 48px; height: 48px; margin-bottom: 10px; color: var(--accent); }
.photo-upload-placeholder p { font-size: 14px; color: var(--text-primary); margin-bottom: 4px; }
.photo-upload-placeholder span { font-size: 12px; }

/* === 搜索栏 === */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.search-box { position: relative; flex: 0 0 auto; width: 340px; max-width: 100%; margin-left: auto; min-width: 200px; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.search-box input { flex: 1 1 0; width: 100%; min-width: 0; padding: 9px 14px 9px 38px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 13px; background: #fff; }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,169,97,0.12); }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search-box .search-go { -webkit-appearance: none; appearance: none; flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 8px 20px; border: 1.5px solid var(--accent); background: linear-gradient(180deg,#fffdf8,#fbf4e6); color: var(--accent-dark); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(156,122,54,.18), inset 0 1px 0 rgba(255,255,255,.65); transition: all .18s ease; }
.search-box .search-go:hover { background: linear-gradient(180deg,var(--accent),var(--accent-dark)); color: #fff; border-color: var(--accent-dark); box-shadow: 0 4px 10px rgba(156,122,54,.32); transform: translateY(-1px); }
.search-box .search-go:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(156,122,54,.3); }
.search-box .search-go svg { position: static; width: 15px; height: 15px; color: currentColor; transform: none; }

/* === 拍照/相册选择面板 === */
.photo-source-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0);
    transition: background 0.25s ease;
    display: flex; align-items: flex-end; justify-content: center;
}
.photo-source-overlay.show { background: rgba(0,0,0,0.45); }
.photo-source-sheet {
    background: #fff; border-radius: 14px 14px 0 0;
    width: 100%; max-width: 420px;
    padding: 8px 0 0; 
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
}
.photo-source-overlay.show .photo-source-sheet { transform: translateY(0); }
.photo-source-item {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px 20px; font-size: 16px; cursor: pointer;
    border-bottom: 1px solid #f0f0f0; color: var(--text-primary);
    transition: background 0.15s;
}
.photo-source-item:active { background: #f5f5f5; }
.photo-source-item svg { width: 22px; height: 22px; color: var(--accent); }
.photo-source-cancel {
    margin-top: 8px; border-top: 8px solid #f5f5f5;
    padding: 16px 20px; text-align: center; font-size: 16px;
    cursor: pointer; color: var(--text-secondary); font-weight: 500;
}
.photo-source-cancel:active { background: #f5f5f5; }

/* === 签名板 === */
.signature-container { max-width: 700px; margin: 0 auto; }

.signature-pad-wrap {
    background: #fff; border: 2px dashed var(--border-color);
    border-radius: var(--radius-md); overflow: hidden; position: relative;
}
.signature-pad-wrap.active { border-color: var(--accent); border-style: solid; }

#signatureCanvas {
    display: block; width: 100%; height: 320px;
    cursor: crosshair; touch-action: none; background: #fafbfc;
    background-image: linear-gradient(rgba(201,169,97,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(201,169,97,0.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

.signature-placeholder { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--text-muted); font-size: 15px; pointer-events: none; text-align: center; }
.signature-placeholder svg { width: 40px; height: 40px; margin-bottom: 8px; opacity: 0.4; }
.signature-tools { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* === 时间线 === */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -28px; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--border-color); z-index: 1; }
.timeline-item.active .timeline-dot { border-color: var(--accent); background: var(--accent); }
.timeline-item.active .timeline-dot::after { content: ''; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.timeline-content h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.timeline-content .timeline-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.timeline-content .timeline-desc { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* === 空状态 === */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* === 提示消息 === */
.alert { padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }
.alert-error { background: #fff5f5; color: #9b2c2c; border: 1px solid #feb2b2; }
.alert-info { background: #ebf8ff; color: #2c5282; border: 1px solid #90cdf4; }

/* === 模态框 === */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 90%; max-width: 520px; max-height: 90vh; box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow: hidden; display: flex; flex-direction: column; }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; }

/* === 信息展示 === */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.info-item { padding: 14px 16px; background: #f7fafc; border-radius: var(--radius-sm); }
.info-item .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.info-item .value { font-size: 14px; font-weight: 500; color: var(--text-primary); }

/* === 签名图片 === */
.signature-img { max-width: 300px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #fafbfc; padding: 8px; }

/* === 物流追踪布局 === */
.track-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }

/* === 已签单确认页（可截图保存） === */
.signed-receipt {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.receipt-header {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    padding: 32px 24px;
    text-align: center;
}

.receipt-title { font-size: 24px; font-weight: 700; letter-spacing: 4px; }
.receipt-subtitle { font-size: 12px; opacity: 0.8; margin-top: 6px; }

.receipt-section { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; }
.receipt-section:last-child { border-bottom: none; }

.receipt-section-title {
    font-size: 13px; font-weight: 600; color: var(--accent-dark);
    margin: 0 auto 12px; padding-bottom: 6px;
    border-bottom: 2px solid var(--accent); display: block;
    text-align: center;
    letter-spacing: 2px;
}

.receipt-info-grid {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}

.receipt-info-item {
    display: table-row;
}

.receipt-info-item > .label,
.receipt-info-item > .value {
    display: table-cell;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    vertical-align: middle;
    text-align: center;
}

.receipt-info-item > .label {
    width: 110px;
    background: #f7fafc;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.receipt-info-item > .value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.receipt-info-item > .value small {
    display: block;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
    margin-top: 2px;
}

.receipt-info-item > .value .addr-block small + small { margin-top: 0; }

/* 同一行两列（左右分块） */
.receipt-info-row {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}
.receipt-info-row > .receipt-info-col {
    display: table-cell;
    width: 50%;
    vertical-align: top;
    padding: 0;
}
.receipt-info-row > .receipt-info-col + .receipt-info-col {
    border-left: 1px solid var(--border-color);
}

.receipt-photo { display:block; margin:0 auto; max-width: 100%; max-height: 300px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }

.receipt-signature { display:block; margin:0 auto; max-width: 300px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #fafbfc; padding: 8px; }

.receipt-footer {
    padding: 16px 24px;
    background: #f7fafc;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* === 响应式：平板 === */
@media (max-width: 1024px) {
    .track-layout { grid-template-columns: 1fr; }
    .receipt-info-grid { grid-template-columns: 1fr; }
}

/* === 响应式：手机 === */
@media (max-width: 768px) {
    /* --- 侧边栏 --- */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }
    .sidebar-overlay.show { display: block; }

    .main { margin-left: 0; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }

    /* --- 顶栏 --- */
    .topbar { padding: 0 14px; height: 52px; }
    .topbar h1 { font-size: 15px; }
    .topbar .user-info span { display: none; }
    .topbar .avatar { width: 28px; height: 28px; font-size: 12px; }
    .topbar-right .btn-outline.btn-sm { padding: 4px 10px; font-size: 11px; }
    .topbar-right .btn-outline.btn-sm svg { width: 13px; height: 13px; }
    .topbar-right { gap: 10px; }

    /* --- 内容区 --- */
    .content { padding: 12px; }

    /* --- 卡片 --- */
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
    .card-header h2 { font-size: 14px; }

    /* --- 统计卡片 --- */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
    .stat-card { padding: 14px; gap: 10px; border-radius: 8px; }
    .stat-card .stat-icon { width: 36px; height: 36px; border-radius: 8px; }
    .stat-card .stat-icon svg { width: 16px; height: 16px; }
    .stat-card .stat-info h3 { font-size: 20px; }
    .stat-card .stat-info p { font-size: 11px; }

    /* --- 仪表盘页头 --- */
    .dashboard-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
    .dashboard-head .dh-title { font-size: 19px; }

    /* --- 工具栏（搜索 + 按钮） --- */
    .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .search-box { width: 340px; max-width: 100%; margin-left: 0; align-self: flex-end; }
    .search-box input { font-size: 16px; }
    .toolbar > div:not(.search-box) { flex-direction: column; gap: 8px; width: 100%; }
    .toolbar > div:not(.search-box) > * { width: 100%; }
    .toolbar select.form-control { width: 100% !important; }
    .toolbar .btn { width: 100%; justify-content: center; }

    /* --- 响应式表格（卡片布局） --- */
    .table-wrap { overflow-x: visible; -webkit-overflow-scrolling: auto; }
    table, table thead, table tbody, table tr { display: block; }
    table { font-size: 13px; }
    table thead { display: none; }
    table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        overflow: hidden;
    }
    table tbody tr { background: #fff; }
    table tbody tr:hover { background: #fff; }
    table tbody td {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;
        padding: 10px 16px;
        border-bottom: 1px solid #f0f0f0;
        text-align: right;
        font-size: 13px;
    }
    table tbody td:last-child { border-bottom: none; }
    table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
        margin-right: auto;
        padding-right: 12px;
        text-align: left;
    }
    /* 标题字段加粗放大，作为卡片标题 */
    table tbody td[data-label="名称"],
    table tbody td[data-label="运单号"],
    table tbody td[data-label="签收人"],
    table tbody td[data-label="用户名"] {
        font-size: 15px;
        font-weight: 700;
        color: var(--text-primary);
        background: rgba(201,169,97,0.3);
        padding-top: 12px;
        padding-bottom: 12px;
    }
    table tbody td[data-label="名称"]::before,
    table tbody td[data-label="运单号"]::before,
    table tbody td[data-label="签收人"]::before,
    table tbody td[data-label="用户名"]::before {
        font-size: 13px;
    }
    /* 图片字段缩小 */
    table tbody td[data-label="图片"] img { width: 48px !important; height: 48px !important; object-fit: cover; border-radius: 6px; }
    /* 简化：隐藏次要字段 */
    table tbody td[data-label="艺术家"],
    table tbody td[data-label="类别"],
    table tbody td[data-label="尺寸"],
    table tbody td[data-label="所属客户"],
    table tbody td[data-label="存储位置"],
    table tbody td[data-label="保额"],
    table tbody td[data-label="入库时间"],
    table tbody td[data-label="承运方"],
    table tbody td[data-label="收件人"],
    table tbody td[data-label="发货日期"],
    table tbody td[data-label="预计送达"],
    table tbody td[data-label="收件电话"],
    table tbody td[data-label="联系电话"],
    table tbody td[data-label="签收照片"],
    table tbody td[data-label="签名"],
    table tbody td[data-label="ID"],
    table tbody td[data-label="显示名称"],
    table tbody td[data-label="创建时间"],
    table tbody td[data-label="最后登录"] {
        display: none !important;
    }
    /* colspan 行（空状态）不转换 */
    table tbody td[colspan] {
        display: block;
        text-align: center;
        padding: 24px 14px;
    }
    table tbody td[colspan]::before { display: none; }
    /* 签收确认表格不受卡片布局影响 */
    table.receipt-info-grid tbody td::before { display: none !important; }
    /* 操作按钮行 */
    table tbody td:last-child > div { flex-wrap: wrap; justify-content: flex-end; }
    table tbody td form { display: inline-flex !important; margin: 0; }

    /* --- 按钮 --- */
    .btn { padding: 8px 14px; font-size: 12px; }
    .btn-sm { padding: 5px 10px; font-size: 11px; }

    /* --- 表单 --- */
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-group { margin-bottom: 14px; }
    .form-control { font-size: 16px; padding: 10px 12px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }

    /* --- 签名板 --- */
    .signature-container { max-width: 100%; }
    #signatureCanvas { height: 200px; }
    .signature-tools { flex-direction: column; }
    .signature-tools .btn { width: 100%; justify-content: center; }

    /* --- 图片/拍照上传 --- */
    .photo-upload-area { min-height: 140px; }
    .image-upload-wrap { min-height: 140px; }

    /* --- 模态框：接近全屏 --- */
    .modal {
        width: 94%;
        max-width: none;
        max-height: 94vh;
        border-radius: 10px;
    }
    .modal-header { padding: 14px 16px; }
    .modal-header h3 { font-size: 15px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-direction: column; gap: 8px; }
    .modal-footer .btn { width: 100%; justify-content: center; }

    /* --- 签收确认单 --- */
    .receipt-header { padding: 20px 14px; }
    .receipt-title { font-size: 18px; letter-spacing: 2px; }
    .receipt-subtitle { font-size: 11px; }
    .receipt-section { padding: 14px; }
    .receipt-section-title { font-size: 12px; letter-spacing: 1px; }
    .receipt-info-item > .label { width: 80px; font-size: 11px; padding: 8px 10px; }
    .receipt-info-item > .value { font-size: 13px; padding: 8px 10px; }
    .receipt-info-item > .value small { font-size: 11px; }
    /* 收寄信息等多列行在手机端堆叠显示 */
    .receipt-info-grid { display: block; }
    .receipt-info-item { display: block; margin-bottom: 8px; border: 1px solid var(--border-color); border-radius: 6px; overflow: hidden; text-align: center; }
    .receipt-info-item > .label,
    .receipt-info-item > .value {
        display: block;
        width: auto;
        text-align: center;
    }
    .receipt-info-item > .label {
        display: inline-block;
        border-bottom: none;
        padding: 4px 12px;
    }
    .receipt-info-item > .value { border-top: none; }
    .receipt-info-item > .value[colspan] { grid-column: auto; }
    .receipt-photo { max-height: 200px; }
    .receipt-signature { max-width: 200px; }
    .receipt-footer { flex-direction: column; gap: 4px; text-align: center; padding: 12px 14px; }

    /* --- info-grid 卡片 --- */
    .info-grid { grid-template-columns: 1fr; gap: 8px; }
    .info-item { padding: 10px 12px; }

    /* --- 分页 --- */
    .pagination { gap: 4px; }
    .pagination a, .pagination span { min-width: 30px; height: 30px; font-size: 12px; padding: 0 8px; }

    /* --- 时间线 --- */
    .timeline { padding-left: 28px; }
    .timeline::before { left: 9px; }
    .timeline-dot { left: -24px; width: 18px; height: 18px; }

    /* --- 内联 flex 布局适配 --- */
    .card[style*="max-width"] { max-width: 100% !important; }
    div[style*="max-width:800px"], div[style*="max-width: 800px"],
    div[style*="max-width:760px"], div[style*="max-width: 760px"],
    div[style*="max-width:700px"], div[style*="max-width: 700px"] { max-width: 100% !important; margin: 0 !important; }

    /* flex 布局在手机端改为纵向堆叠 */
    div[style*="display:flex"][style*="gap:16px"],
    div[style*="display: flex"][style*="gap: 16px"],
    div[style*="display:flex"][style*="gap:20px"],
    div[style*="display: flex"][style*="gap: 20px"],
    div[style*="display:flex"][style*="gap:8px"],
    div[style*="display: flex"][style*="gap: 8px"] { flex-direction: column !important; gap: 10px !important; }

    /* gap:10px 的容器允许换行（工具栏按钮等） */
    div[style*="display:flex"][style*="gap:10px"],
    div[style*="display: flex"][style*="gap: 10px"] { flex-wrap: wrap; }

    /* 限制图片宽度 */
    img[style*="width:72px"], img[style*="width: 72px"] { width: 60px !important; height: 60px !important; }
    img[style*="width:120px"], img[style*="width: 120px"] { width: 80px !important; height: 80px !important; }
    img[style*="width:100px"], img[style*="width: 100px"] { width: 80px !important; height: 80px !important; }
    img[style*="width:64px"], img[style*="width: 64px"] { width: 56px !important; height: 56px !important; }
}

/* === 响应式：小手机 === */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content { padding: 10px; }
    .topbar { padding: 0 10px; }
    .topbar h1 { font-size: 14px; }
    .card-body { padding: 12px; }
    .card-header { padding: 10px 12px; }
    .dashboard-head .dh-date { font-size: 12px; padding: 6px 12px; }

    .receipt-title { font-size: 16px; letter-spacing: 1px; }
    .receipt-info-item > .label { width: 70px; }

    /* 签收确认工具栏按钮全宽 */
    .toolbar .btn { font-size: 12px; }
}

/* === 顶栏用户区域微调 === */
.topbar-right .user-info {
    gap: 6px;
}

.topbar-right .btn-outline.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.topbar-right .btn-outline.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* === 分页 === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px;
    border-radius: var(--radius-sm); font-size: 13px;
    border: 1px solid var(--border-color); background: #fff;
    color: var(--text-secondary); text-decoration: none; cursor: pointer;
    transition: all 0.15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: #fffaf0; }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.pagination .disabled { color: var(--text-muted); opacity: 0.5; cursor: default; background: #f7fafc; }
.pagination .page-info { border: none; background: none; color: var(--text-muted); font-size: 12px; }

/* === 客户管理：两个图标视图切换器 === */
.view-switch {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    margin-bottom: 20px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.vs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}
.vs-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.vs-item:hover { color: var(--text-primary); background: #fff; }
.vs-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 4px 10px rgba(201, 169, 97, 0.25);
}
.vs-item.active:hover { color: #fff; }
.vs-badge {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: inherit;
}
.vs-item:not(.active) .vs-badge { background: #e2e8f0; color: var(--text-secondary); }

@media (max-width: 520px) {
    .view-switch { display: flex; width: 100%; }
    .vs-item { flex: 1; justify-content: center; padding: 10px 8px; }
}
