/* ===================================================
   装柜拍照管理系统 - 样式表
   现代化 UI - 适配企业微信H5移动端 + PC管理后台
   =================================================== */

/* ===================================================
   设计规范 v1 色彩 Token（实测自工资统计系统 v5.20.3）
   旧变量名保留为别名，避免破坏既有 var() 引用
   =================================================== */
:root {
    /* 品牌/顶部渐变 */
    --nav-grad: linear-gradient(90deg,#0b1220 0%,#14233f 70%,#1b2f52 100%);   /* 顶部/品牌深蓝黑渐变 */
    --accent-grad: linear-gradient(90deg,#1e3a8a,#2563eb);                    /* 选中高亮渐变 */
    --bright-grad: linear-gradient(135deg,#4da3ff,#1e6fff);                   /* 高亮 */
    /* 主色/主按钮 */
    --primary: #1890ff;          /* 主色/链接/焦点 */
    --primary-deep: #0967d2;
    --btn-grad: linear-gradient(180deg,#1890ff,#0967d2);                      /* 主按钮渐变 */
    --primary-dark: #0967d2;     /* 旧名：主色加深（hover）= primary-deep */
    --primary-light: #e6f7ff;    /* 旧名：主色浅底（选中浅蓝） */
    --primary-lighter: #eff6ff;  /* 旧名：主色更浅底 */
    /* 次要强调（旧蓝灰 → 中性灰阶） */
    --secondary: #64748b;
    --secondary-light: #f1f5f9;
    /* 语义色 */
    --warning: #d97706;          /* 暖橙：部分完成/待审核 */
    --warning-light: #fff7ed;
    --danger: #dc2626;           /* 红：删除/缺传 */
    --danger-light: #fef2f2;
    --success: #16a34a;          /* 绿：完成 */
    --success-light: #f0fdf4;
    --ok:#16a34a; --ok-deep:#15803d; --ok-grad:linear-gradient(180deg,#16a34a,#15803d);
    --warn:#d97706; --warn-deep:#b45309;
    --err:#dc2626;
    --teal:#0e7490; --teal-deep:#155e75; --teal-grad:linear-gradient(180deg,#0e7490,#155e75);
    /* 文本四级 */
    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --t1:#1e293b; --t2:#334155; --t3:#64748b; --t4:#94a3b8;
    /* 边框/背景 */
    --line:#e2e8f0; --line-strong:#cbd5e1;
    --bg:#f8fafc; --bg-soft:#f1f5f9; --card:#ffffff;
    --bg-page: #f5f7fa;          /* 页面背景 */
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --border-color: #e2e8f0;
    --border-light: #eef2f7;     /* 表格行分隔线 */
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.05);
    --shadow-md: 0 4px 16px rgba(15,23,42,0.06);
    --shadow-lg: 0 12px 40px rgba(15,23,42,0.10);
    /* 圆角/字号/间距 */
    --radius: 8px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xs: 6px;
    --fs-base: 14px; --fs-sm: 13px;
    --gap: 16px;
    --transition: all 0.2s ease;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    /* 统一高级感层变量（旧定义保留） */
    --border-hair: rgba(15,23,42,0.08);
    --shadow-card-hover: 0 8px 28px rgba(15,23,42,0.10);
    --table-stripe: #f8fafc;
    --table-hover: rgba(24,144,255,0.06);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    caret-color: transparent;
}
input, textarea { caret-color: auto; }

/* 键盘焦点可见性（WCAG 2.4.7）：键盘操作时显示清晰焦点环 */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}
.nav-tab:focus-visible,
[role="tab"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* ===================================================
   司机端 - 登录页
   =================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nav-grad);   /* 品牌/登录渐变：规范 v1 */
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.login-card {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 28px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 16px 48px rgba(15,23,42,0.12);
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-logo {
    font-size: 64px;
    margin-bottom: 4px;
    line-height: 1;
}

.login-card h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.login-hint {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* Fleet Select */
.fleet-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.fleet-select-list::-webkit-scrollbar,
.driver-select-list::-webkit-scrollbar {
    width: 4px;
}

.fleet-select-list::-webkit-scrollbar-thumb,
.driver-select-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 2px;
}

.fleet-item {
    padding: 16px 18px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
}

.fleet-item:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
    transform: translateX(2px);
}

.fleet-item:active {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(0.98);
}

.fleet-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary);
    flex-shrink: 0;
}

.fleet-item-name {
    flex: 1;
    font-weight: 600;
}

.fleet-item-count {
    font-size: 13px;
    color: var(--text-tertiary);
    background: var(--border-light);
    padding: 2px 10px;
    border-radius: 10px;
}

/* Driver Select */
.driver-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.driver-item {
    padding: 16px 18px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
}

.driver-item:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
    transform: translateX(2px);
}

.driver-item:active {
    background: var(--primary-light);
    transform: scale(0.98);
}

.driver-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--success-light);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.driver-item-name {
    font-weight: 500;
    flex: 1;
}

/* Password Login */
.btn-back-step {
    padding: 6px 14px;
    background: var(--border-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-back-step:hover {
    background: #e2e8f0;
}

.btn-login-confirm {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(15,23,42,0.18);
}

.btn-login-confirm:hover {
    box-shadow: 0 6px 20px rgba(15,23,42,0.22);
    transform: translateY(-1px);
}

.btn-login-confirm:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(15,23,42,0.16);
}

/* WeCom OAuth Button */
.btn-wecom-oauth {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-wecom-oauth:hover {
    background: #0967d2;
}

/* ===================================================
   司机端 - 主应用
   =================================================== */
.header {
    background: var(--nav-grad);   /* 顶部/品牌渐变：规范 v1 */
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(11,18,32,0.18);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

#driver-name {
    font-weight: 500;
    opacity: 0.95;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* Main Content */
.main-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 80px;
}

/* View Switching */
.view { display: block; }
.view.hidden { display: none; }

.view-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.view-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.btn-back {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 15px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.btn-back:hover {
    background: var(--primary-light);
}

.badge {
    background: var(--success-light);
    color: var(--success);
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
}

/* ===================================================
   司机端 - 搜索栏
   =================================================== */
.search-container {
    padding: 16px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.search-bar {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition);
    outline: none;
    background: var(--bg-page);
}

.search-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(24,144,255,0.18);
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(15,23,42,0.14);
}

.search-btn:hover {
    box-shadow: 0 4px 14px rgba(15,23,42,0.18);
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(0);
}

.search-hint {
    margin: 8px 0 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ===================================================
   司机端 - 柜号列表
   =================================================== */
.container-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.container-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.container-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--primary-light);
}

.container-item:active {
    transform: scale(0.98);
}

.container-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* 柜号：司机装柜前要核对的关键信息 → 大字号、加粗、等宽感（2026-09-12 王总要求） */
.container-no-big {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 1.5px;
    line-height: 1.25;
}
.cur-no {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
    line-height: 1.2;
}
.cnl {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0;
}
.container-no {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.container-status-row {
    display: flex;
    gap: 6px;
}

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

.status-tag.complete {
    background: var(--success-light);
    color: var(--success);
}

.status-tag.incomplete {
    background: var(--warning-light);
    color: var(--warning);
}

.container-progress {
    display: flex;
    gap: 16px;
}

.progress-item {
    flex: 1;
}

.progress-item-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 5px;
}

.progress-mini-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-mini-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-mini-fill.complete {
    background: var(--success);
}

.progress-mini-fill.incomplete {
    background: var(--warning);
}

/* ===================================================
   司机端 - 上传视图
   =================================================== */
.category-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

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

.category-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.status-badge {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.status-badge.complete {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.incomplete {
    background: var(--warning-light);
    color: var(--warning);
}

.category-note {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.upload-info-bar {
    padding: 10px 14px;
    background: var(--secondary-light);
    border-radius: var(--radius-sm);
    margin: 10px 0;
    font-size: 14px;
    color: var(--secondary);
    font-weight: 500;
}

/* Photo Grid - 网格布局 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.photo-item {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: var(--bg-hover);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item.uploaded {
    border-color: #bbf7d0;
    background: var(--success-light);
}

.photo-item:hover {
    box-shadow: var(--shadow-sm);
}

.photo-item .photo-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.photo-item.uploaded .photo-index {
    background: var(--success);
    color: #fff;
}

.photo-item .photo-info {
    display: none;
}

.photo-item .photo-name {
    font-size: 12px;
    color: var(--text-tertiary);
}

.photo-item .photo-status-text {
    font-size: 11px;
    color: var(--text-muted);
}

.photo-item.uploaded .photo-status-text {
    color: var(--success);
}

.photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.photo-item.uploaded:hover .photo-preview {
    transform: scale(1.04);
}

/* ===== 上传：暂存区（连续多选） ===== */
.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.upload-all-btn {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(22,163,74,0.18);
}

.upload-all-btn:hover {
    box-shadow: 0 4px 14px rgba(22,163,74,0.24);
    transform: translateY(-1px);
}

.btn-clear-staged {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear-staged:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.staged-tray {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-hover);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
}

.staged-tray:empty {
    display: none;
}

.staged-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: zoom-in;
}

.staged-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staged-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
}

.staged-remove:hover {
    background: var(--danger);
}

/* ===== 照片大图灯箱 ===== */
.photo-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.photo-lightbox.show {
    display: flex;
}

.photo-lightbox img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    line-height: 38px;
    text-align: center;
    cursor: pointer;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-hint {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
}

/* Photo Actions inside grid item */
.photo-item .photo-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-item:hover .photo-actions {
    opacity: 1;
}

/* Buttons */
.btn-photo {
    padding: 8px 18px;
    border: 1.5px solid var(--primary);
    background: #fff;
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    font-weight: 500;
}

.btn-photo:hover {
    background: var(--primary-light);
}

.btn-photo.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(15,23,42,0.14);
}

.btn-photo.primary:hover {
    box-shadow: 0 4px 14px rgba(15,23,42,0.18);
    transform: translateY(-1px);
}

.btn-photo.retake {
    border-color: var(--warning);
    color: var(--warning);
}

.btn-photo.retake:hover {
    background: var(--warning-light);
}

.btn-photo.preview {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-photo.replace {
    border-color: rgba(255,255,255,0.6);
    color: #fff;
    background: rgba(217,119,6,0.85);
    font-size: 11px;
    padding: 3px 8px;
    backdrop-filter: blur(4px);
}

/* Submit Button */
.btn-submit {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(15,23,42,0.18);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15,23,42,0.12);
}

.btn-submit:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Confirm Upload Button */
.btn-confirm-upload {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(15,23,42,0.18);
}

.btn-confirm-upload:active {
    opacity: 0.9;
}

.btn-confirm-upload:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Confirm Status */
.badge-confirmed {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--success-light);
    color: var(--success);
    font-weight: 600;
}

.badge-unconfirmed {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--warning-light);
    color: var(--warning);
    font-weight: 600;
}

#confirm-status-bar {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Footer */
.footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(241,245,249,0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-light);
}

/* ===================================================
   Toast & Loading
   =================================================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    white-space: pre-line;
    max-width: 90vw;
    line-height: 1.6;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: toastIn 0.25s ease;
    display: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.toast:not(.hidden) {
    display: block;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state .icon {
    font-size: 52px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ===================================================
   响应式 - 移动端优化
   =================================================== */
@media (max-width: 480px) {
    .header h1 { font-size: 16px; }
    .container-no { font-size: 16px; }
    .container-no-big { font-size: 22px; letter-spacing: 1px; }
    .cur-no { font-size: 26px; }
    .btn-photo { padding: 7px 14px; font-size: 13px; }
    .login-card { padding: 32px 20px 28px; }
    .login-logo { font-size: 52px; }
    .login-card h2 { font-size: 22px; }
    .main-content { padding: 12px; padding-bottom: 80px; }
    .category-section { padding: 16px; }
    .container-item { padding: 14px; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 8px; }
}

@media (min-width: 768px) {
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ===================================================
   管理后台 - 通用样式
   =================================================== */
.admin-layout {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 20px;
}

.btn {
    padding: 9px 22px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: var(--btn-grad);   /* 主按钮渐变：规范 v1 */
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 10px rgba(15,23,42,0.14);
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-lighter);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.hidden { display: none !important; }

/* ===================================================
   管理后台 - 登录页
   =================================================== */
.login-form {
    max-width: 420px;
    margin: 80px auto;
    padding: 48px 40px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-sizing: border-box;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24,144,255,0.18);
}

/* ===================================================
   管理后台 - 顶部栏 + Tab导航
   =================================================== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 16px 0;
}

.admin-header h1 {
    font-size: 20px;         /* 页面大标题：规范 v1 20px/600 */
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
}

.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tab {
    padding: 12px 24px;
    font-size: 15px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
}

.nav-tab:hover {
    color: var(--primary);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    min-height: 400px;
}

/* ===================================================
   管理后台 - 照片总览
   =================================================== */
.import-section { margin-bottom: 20px; }
.import-section h3 { margin-bottom: 14px; font-size: 17px; font-weight: 700; }

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-hover);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-bar-admin {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.summary-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.bl-group {
    margin-bottom: 28px;
    border-left: 4px solid var(--primary);
    padding-left: 20px;
}

.bl-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.bl-group-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.bl-group-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 4px;
}

.bl-group-count {
    font-size: 13px;
    color: var(--text-tertiary);
    background: var(--border-light);
    padding: 3px 12px;
    border-radius: 12px;
}

.bl-group-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

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

.card-title {
    font-size: 17px;
    font-weight: 700;
}

.card-driver {
    font-size: 13px;
    color: var(--text-tertiary);
}

.progress-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.progress-value {
    font-size: 13px;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    margin-bottom: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-fill.complete { background: var(--success); }
.progress-fill.incomplete { background: var(--warning); }
.progress-fill.empty { background: #e2e8f0; }

.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-status.complete {
    background: var(--success-light);
    color: var(--success);
}

.badge-status.incomplete {
    background: var(--warning-light);
    color: var(--warning);
}

.missing-list {
    font-size: 13px;
    color: var(--danger);
    line-height: 1.8;
    margin-top: 8px;
}

.search-result-section {
    margin-bottom: 24px;
    border-left: 4px solid var(--secondary);
    padding-left: 16px;
}

/* ===================================================
   管理后台 - 照片弹窗
   =================================================== */
.photo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.photo-modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 760px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: modalIn 0.25s ease;
}

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

.photo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.photo-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.photo-grid-modal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.photo-card-modal {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 10px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition);
}

.photo-card-modal:hover {
    box-shadow: var(--shadow-sm);
}

.photo-card-modal img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.photo-card-modal .photo-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.photo-card-modal .photo-meta-title {
    font-weight: 600;
    color: var(--text-primary);
}

.photo-card-modal .photo-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 2;
    accent-color: var(--danger);
}

.photo-card-modal.selected {
    border: 2px solid var(--danger);
    background: var(--danger-light);
}

.photo-batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.photo-batch-bar .batch-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.photo-batch-bar .batch-btn {
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

/* ===================================================
   管理后台 - 车队管理
   =================================================== */
.fleet-card {
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.fleet-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.fleet-card .fleet-name {
    font-weight: 700;
    font-size: 16px;
}

.fleet-card .fleet-count {
    font-size: 12px;
    color: var(--text-tertiary);
}

.fleet-card .fleet-internal {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.fleet-card .fleet-actions {
    margin-top: 10px;
    display: flex;
    gap: 6px;
}

.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* ===================================================
   管理后台 - 司机管理
   =================================================== */
.pwd-badge-locked {
    color: var(--secondary);
    font-size: 11px;
    font-weight: 600;
}

.pwd-badge-none {
    color: var(--text-muted);
    font-size: 11px;
}

.driver-fleet-group {
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    padding-left: 16px;
}

.driver-fleet-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.driver-fleet-group-header:hover {
    background: var(--bg-hover);
}

.driver-fleet-group-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.driver-fleet-group-count {
    font-size: 13px;
    color: var(--text-tertiary);
}

.driver-fleet-group-toggle {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ===================================================
   管理后台 - 柜号查询
   =================================================== */
.query-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.query-card h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 700;
}

.query-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition);
    outline: none;
}

.query-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24,144,255,0.18);
}

.query-results {
    margin-top: 20px;
}

/* ===================================================
   管理后台 - 柜照清单表格
   =================================================== */
.detail-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.detail-toolbar .batch-info {
    font-size: 13px;
    color: var(--text-tertiary);
}

.detail-toolbar .batch-info.has-selected {
    color: var(--primary);
    font-weight: 600;
}

.detail-table {
    width: 100%;
    min-width: 1120px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table th {
    background: var(--bg-page);
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    color: var(--text-secondary);
}

.detail-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 长文本列（客户/提单号）折行完整展示，其余列超宽省略 */
.detail-table td.dt-wrap {
    white-space: normal;
    word-break: break-all;
    line-height: 1.35;
}

.detail-table td.dt-center { text-align: center; }

.detail-table td.dt-ops { white-space: nowrap; }

/* 操作列按钮：单行紧凑排布，等宽不换行 */
.detail-table td.dt-ops > div {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}

/* 高优先级覆盖 .btn / .download-btn 的基础尺寸：操作列 4 键统一小尺寸 */
.detail-table .dt-btn {
    padding: 3px 8px;
    font-size: 11.5px;
    line-height: 1;
    height: 22px;
    border-radius: 5px;
    white-space: nowrap;
    text-align: center;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* 「查看」等按钮的禁用态：无照片时灰度、不可点（有照片后激活） */
.detail-table .dt-btn[disabled] {
    background: #f8fafc;
    color: #b6bdc9;
    border: 1px solid #e5e7eb;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 1400px) {
    .detail-table th { padding: 10px 7px; }
    .detail-table td { padding: 9px 7px; }
    .detail-table td.dt-ops > div { gap: 3px; }
}

.detail-table tr:hover td {
    background: var(--bg-hover);
}

.detail-table tr.selected td {
    background: var(--primary-lighter);
}

.detail-table-wrap {
    overflow: auto;
    max-height: max(420px, calc(100vh - 230px));
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

/* 表头固定：随表格容器滚动吸顶 */
.detail-table thead th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f1f5f9;
    box-shadow: inset 0 -2px 0 var(--border-color);
}

/* 列筛选 */
.col-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background: #fff;
    vertical-align: middle;
    transition: var(--transition);
}

.col-filter-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.col-filter-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.col-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    min-width: 180px;
    max-width: 260px;
    max-height: 340px;
    overflow-y: auto;
}

.col-filter-dropdown .filter-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 10px;
    box-sizing: border-box;
    outline: none;
    transition: var(--transition);
}

.col-filter-dropdown .filter-search:focus {
    border-color: var(--primary);
}

.col-filter-dropdown .filter-actions {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    margin-top: 10px;
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
}

.col-filter-dropdown .filter-actions button {
    padding: 5px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.col-filter-dropdown .filter-actions .btn-ok {
    background: var(--btn-grad);
    color: #fff;
}

.col-filter-dropdown .filter-actions .btn-cancel {
    background: var(--border-light);
    color: var(--text-secondary);
}

.col-filter-dropdown .filter-actions .btn-select-all {
    background: var(--btn-grad);
    color: #fff;
}

.col-filter-dropdown .filter-actions .btn-select-invert {
    background: var(--secondary);
    color: #fff;
}

.col-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    border-radius: 4px;
    padding-left: 4px;
}

.col-filter-item:hover {
    background: var(--bg-hover);
}

.col-filter-item input[type="checkbox"] {
    accent-color: var(--primary);
}

/* ===================================================
   管理后台 - 下载中心
   =================================================== */
.download-section {
    margin-bottom: 24px;
}

.download-section h3 {
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 700;
}

.download-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.download-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 10px rgba(15,23,42,0.14);
}

.download-btn.secondary {
    background: var(--secondary);
}

.download-btn.secondary:hover {
    background: #0967d2;
}

/* 模糊搜索弹窗 */
.search-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.search-popup {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 500px;
    max-width: 90vw;
    max-height: 72vh;
    box-shadow: 0 16px 48px rgba(15,23,42,0.12);
    overflow: hidden;
    animation: modalIn 0.25s ease;
}

.search-popup-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-popup-header input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--secondary);
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
}

.search-popup-body {
    padding: 10px 16px;
    max-height: 420px;
    overflow-y: auto;
}

.search-popup-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    margin: 2px 0;
}

.search-popup-item:hover {
    background: var(--secondary-light);
}

.search-popup-item .item-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.search-popup-item .item-sub {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.search-popup-item .item-type {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 8px;
    font-weight: 500;
}

.item-type-bl_no { background: var(--secondary-light); color: var(--secondary); }
.item-type-container_no { background: var(--success-light); color: var(--success); }
.item-type-customer { background: #fff7ed; color: #d97706; }

.search-popup-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.search-popup-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.search-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.search-btn-icon:hover {
    background: #0967d2;
}

/* ===================================================
   WeChat OAuth Button
   =================================================== */
.btn-wecom-login {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    margin-top: 12px;
    transition: var(--transition);
}

.btn-wecom-login:hover {
    background: var(--primary-light);
}

.btn-wecom-login:disabled {
    border-color: var(--text-muted);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ===================================================
   管理后台 - 响应式
   =================================================== */
@media (max-width: 768px) {
    .admin-layout { padding: 16px; }
    .admin-header h1 { font-size: 20px; }
    .nav-tab { padding: 10px 16px; font-size: 14px; }
    .bl-group-cards { grid-template-columns: 1fr; }
    .login-form { margin: 24px 16px; padding: 32px 24px; }
    .photo-modal { padding: 20px; }
    .photo-grid-modal { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}


/* ====================================================
   统一高级感层（UI 升级 v20260801b）
   三端一致：1px 细腻描边 / 按钮微动效 / 表格斑马纹+悬浮高亮
   ==================================================== */

:root {
  --border-hair: rgba(15,23,42,0.08);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card-hover: 0 8px 28px rgba(15,23,42,0.10);
  --table-stripe: #f8fafc;
  --table-hover: rgba(24,144,255,0.06);
  --radius-xs: 6px;
}

/* —— 卡片 1px 细腻描边 —— */
.card, .login-form, .login-card, .table-card, .search-bar,
.detail-table-wrap, .modal, .photo-modal, .panel, .query-card {
  border: 1px solid var(--border-hair);
}
.photo-modal, .modal { border-color: var(--border-color); }

/* —— 按钮微动效（统一三端） —— */
.btn, .btn-primary, .btn-outline, .btn-danger, .btn-submit,
.btn-confirm-upload, .btn-photo, .btn-photo.primary, .btn-photo.retake,
.btn-photo.preview, .btn-photo.replace, .dl-btn, .btn-logout,
.btn-back, .btn-back-step, .btn-login-confirm, .btn-wecom-oauth,
.btn-wecom-login, .btn-login {
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease);
}
.btn:hover, .btn-primary:hover, .btn-outline:hover, .btn-danger:hover,
.btn-submit:hover, .btn-confirm-upload:hover, .btn-photo:hover,
.dl-btn:hover, .btn-logout:hover, .btn-back:hover, .btn-back-step:hover,
.btn-login-confirm:hover, .btn-wecom-oauth:hover, .btn-wecom-login:hover,
.btn-login:hover {
  transform: translateY(-1px);
}
.btn:active, .btn-primary:active, .btn-outline:active, .btn-danger:active,
.btn-submit:active, .btn-confirm-upload:active, .btn-photo:active,
.dl-btn:active, .btn-logout:active, .btn-back:active, .btn-back-step:active,
.btn-login-confirm:active, .btn-login:active {
  transform: translateY(0) scale(0.975);
}
.btn-primary:hover, .btn-submit:hover, .btn-confirm-upload:hover,
.btn-photo.primary:hover, .btn-login-confirm:hover, .btn-login:hover {
  box-shadow: 0 6px 18px rgba(15,23,42,0.18);
}
.btn-danger:hover { box-shadow: 0 6px 16px rgba(220,38,38,0.30); }
.dl-btn:hover { box-shadow: 0 4px 12px rgba(15,23,42,0.12); }
.btn:disabled, .btn-primary:disabled, .btn-submit:disabled,
.btn-confirm-upload:disabled, .btn-photo:disabled { transform: none; opacity: 0.6; }

/* —— 表格：斑马纹 + 悬浮高亮（admin 柜照清单 & 门户清单共用） —— */
.detail-table, .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.detail-table thead th, .data-table thead th {
  background: #f1f5f9;   /* 表头浅底：规范 v1 */
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}
.detail-table tbody td, .data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
.detail-table tbody tr:nth-child(even) td,
.data-table tbody tr:nth-child(even) td {
  background: var(--table-stripe);
}
.detail-table tbody tr:hover td,
.data-table tbody tr:hover td {
  background: var(--table-hover);
}
.detail-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.detail-table tbody tr.selected td { background: var(--primary-lighter); }

/* 卡片式表格容器圆角 */
.table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #fff;
}

/* —— 徽章精致化 —— */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.badge-ok { background: var(--success-light); color: var(--success); }
.badge-wait { background: var(--warning-light); color: var(--warning); }
.status-badge.complete { box-shadow: inset 0 0 0 1px rgba(22,163,74,0.25); }
.status-badge.incomplete { box-shadow: inset 0 0 0 1px rgba(217,119,6,0.25); }

/* —— 输入框聚焦描边 —— */
.form-group input:focus, .search-bar input:focus, .login-card input:focus,
.query-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,144,255,0.18);
}

/* ============ 客户端门户特有（统一收编至此） ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--nav-grad);  /* 品牌/登录渐变：规范 v1 */
}
.login-card {
  background: #fff; border: 1px solid var(--border-hair); border-radius: 20px;
  padding: 40px 32px; box-shadow: 0 16px 48px rgba(15,23,42,0.12);
  width: 100%; max-width: 380px; text-align: center; position: relative; z-index: 1;
}
.login-card h1 { font-size: 22px; margin-bottom: 8px; color: var(--text-primary); }
.login-card .subtitle { color: var(--text-tertiary); font-size: 13px; margin-bottom: 32px; }
.login-card .input-group { margin-bottom: 16px; text-align: left; }
.login-card label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 15px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card .btn-login {
  width: 100%; padding: 13px; background: var(--btn-grad); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: transform 0.16s var(--ease), background-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
  margin-top: 8px;
}
.login-card .btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,23,42,0.18); }
.login-card .btn-login:active { transform: translateY(0) scale(0.975); }
.login-error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

.portal-layout { max-width: 1200px; margin: 0 auto; padding: 24px; }
.portal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.portal-header h2 { font-size: 20px; font-weight: 700; }
.portal-header .user-info { font-size: 14px; color: var(--text-secondary); }
.portal-header .user-info span { color: var(--primary); font-weight: 600; }

.search-bar {
  background: #fff; border: 1px solid var(--border-hair); border-radius: var(--radius-md);
  padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.search-bar input[type="text"], .search-bar input[type="date"] {
  padding: 9px 12px; border: 1px solid var(--border-color);
  border-radius: var(--radius-xs); font-size: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar input[type="text"] { flex: 1; min-width: 150px; }
.search-bar .record-count { font-size: 13px; color: var(--text-tertiary); margin-left: auto; }

.table-card { background: #fff; border: 1px solid var(--border-hair); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }

.container-no { font-weight: 600; }

.dl-btn {
  padding: 5px 12px; font-size: 12px; border: 1px solid var(--primary);
  color: var(--primary); background: #fff; border-radius: var(--radius-xs);
  cursor: pointer; transition: transform 0.16s var(--ease), background-color 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
  margin-right: 4px;
}
.dl-btn:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,23,42,0.12); }
.dl-btn:active { transform: translateY(0) scale(0.97); }

.cat-checks { display: flex; gap: 12px; align-items: center; }
.cat-checks label { font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 4px; }

.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.7);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}
.loading-overlay.show { display: flex; }
.loading-overlay .spinner {
  width: 40px; height: 40px; border: 3px solid #e2e8f0;
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: none;
  align-items: center; justify-content: center; z-index: 10001;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 90%; max-height: 85vh; object-fit: contain; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px; color: #fff;
  font-size: 28px; cursor: pointer; opacity: 0.7; transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 36px; cursor: pointer; opacity: 0.6; user-select: none;
  transition: opacity 0.2s; padding: 0 16px;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

@media (max-width: 768px) {
  .portal-layout { padding: 12px; }
  .data-table, .detail-table { font-size: 12px; }
  .data-table th, .data-table td, .detail-table th, .detail-table td { padding: 8px 10px; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .search-bar input[type="text"] { min-width: auto; }
}

/* ============ 客户端门户（portal）手机端优化 ============ */
@media (max-width: 768px) {
  /* 登录卡片更紧凑 */
  .login-wrap { padding: 16px; }
  .login-card { padding: 28px 22px; border-radius: 16px; }
  .login-card h1 { font-size: 20px; }
  .login-card input { font-size: 16px; padding: 13px 14px; }  /* 防止iOS自动放大 */
  .login-card .btn-login { padding: 14px; font-size: 16px; }

  /* 头部布局 */
  .portal-header { gap: 8px; }
  .portal-header h2 { font-size: 18px; }
  .portal-header .user-info { font-size: 13px; }

  /* 搜索栏：日期范围横向并排，输入框全宽，按钮全宽 */
  .search-bar { padding: 12px; gap: 8px; }
  .search-bar input[type="date"],
  .search-bar input[type="text"] {
    width: 100%; min-width: 0; font-size: 16px; padding: 11px 12px;
  }
  .search-bar .cat-checks { width: 100%; justify-content: flex-start; padding: 4px 0; }
  .search-bar .btn { width: 100%; padding: 12px; font-size: 15px; }

  /* 表格容器：允许内部横向滚动，避免内容被截 */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 720px; }  /* 10 列窄屏下保持最小可读宽度，启用横向滚动 */

  /* 表格内按钮竖向堆叠，便于手指点击 */
  .data-table td { white-space: nowrap; }
  .data-table td:last-child { white-space: normal; min-width: 90px; }
  .dl-btn { display: block; width: 100%; margin: 3px 0; padding: 7px 10px; font-size: 13px; }

  /* 备案页脚 */
  .site-footer { padding: 14px 12px 24px; font-size: 11px; }
}

/* ===== 司机端：浏览器多选（企微内引导跳出到系统浏览器） ===== */
.btn-photo.ghost {
  background: #fff;
  color: var(--primary, #1890ff);
  border: 1.5px solid var(--primary, #1890ff);
}
.btn-photo.ghost:hover { background: #f1f5f9; }

.browser-guide {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(11,18,32,0.6); padding: 24px;
}
.browser-guide.show { display: flex; }
.bg-card {
  background: #fff; border-radius: 16px; max-width: 360px; width: 100%;
  padding: 28px 24px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  animation: bgPop 0.22s ease;
}
@keyframes bgPop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bg-icon { font-size: 46px; margin-bottom: 10px; }
.bg-card h3 { margin: 0 0 12px; font-size: 18px; color: var(--primary, #1890ff); }
.bg-card p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: #64748b; }
.bg-tip { font-size: 12.5px !important; color: #16a34a !important; background: #f0fdf4; border-radius: 8px; padding: 8px 10px; }
.bg-btn {
  margin-top: 14px; width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--primary, #1890ff); color: #fff; font-size: 15px; cursor: pointer;
  transition: opacity 0.2s;
}
.bg-btn:hover { opacity: 0.88; }

/* ===== 页面底部备案信息 ===== */
.site-footer {
  margin-top: 40px;
  padding: 18px 16px 30px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: #64748b;
  border-top: 1px solid #eef1f5;
}
.site-footer .sf-line + .sf-line { margin-top: 2px; }
.site-footer a { color: #64748b; }
