/* ============================================
   嘉鸿-后台管理系统 样式
   PC + 移动端响应式
   ============================================ */

:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --primary-light: #E8F2FC;
    --success: #52C41A;
    --warning: #FAAD14;
    --danger: #FF4D4F;
    --text-main: #333;
    --text-secondary: #666;
    --text-hint: #999;
    --bg-page: #F0F2F5;
    --bg-card: #fff;
    --border: #E8E8E8;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
}

a { text-decoration: none; color: inherit; }

/* ==================== Toast & Loading ==================== */

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 400px;
    text-align: center;
    animation: toastIn 0.3s ease;
}

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

#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.5);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}

#loading-overlay.show { display: flex; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(74,144,217,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 登录页 ==================== */

.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2a3a 0%, #2c3e50 100%);
    padding: 20px;
}

.admin-login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.admin-login-box .login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-login-box .login-icon svg { width: 32px; height: 32px; }

.admin-login-box h1 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}

.admin-login-box .subtitle {
    text-align: center;
    color: var(--text-hint);
    font-size: 13px;
    margin-bottom: 28px;
}

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

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

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    background: #FAFBFC;
}

.form-input:focus {
    border-color: var(--primary);
    background: #fff;
}

.code-group { display: flex; gap: 10px; }
.code-group .form-input { flex: 1; }

.btn-send-code {
    flex-shrink: 0;
    width: 120px;
    height: 44px;
    border: 1.5px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    background: var(--primary-light);
    cursor: pointer;
}

.btn-send-code:disabled {
    border-color: var(--border);
    color: var(--text-hint);
    background: #F5F5F5;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.btn-primary:active { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; }

.back-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}

.back-link a { color: var(--text-hint); }
.back-link a:hover { color: var(--primary); }

/* ==================== 后台布局 ==================== */

.admin-layout { min-height: 100vh; }

.admin-topbar {
    height: 56px;
    background: #001529;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.admin-topbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.admin-topbar .logo svg { width: 24px; height: 24px; }

.admin-topbar .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.admin-topbar .user-info .user-name { opacity: 0.85; }

.admin-topbar .btn-logout {
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    background: none;
    transition: all 0.2s;
}

.admin-topbar .btn-logout:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.admin-body { padding: 20px; max-width: 1400px; margin: 0 auto; }

/* ==================== 统计卡片 ==================== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon svg { width: 24px; height: 24px; }

.stat-icon.blue   { background: #E6F7FF; color: #1890FF; }
.stat-icon.green  { background: #F6FFED; color: #52C41A; }
.stat-icon.orange { background: #FFF7E6; color: #FAAD14; }
.stat-icon.red    { background: #FFF1F0; color: #FF4D4F; }
.stat-icon.purple { background: #F9F0FF; color: #722ED1; }

.stat-card .stat-info .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-info .stat-label {
    font-size: 13px;
    color: var(--text-hint);
    margin-top: 2px;
}

/* Tab导航 */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.admin-tab {
    padding: 10px 20px;
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

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

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

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 时间段统计 */
.stats-time {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card-mini {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.stat-card-mini:active { transform: scale(0.97); }

.stat-card-mini .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card-mini .stat-label {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 4px;
}

/* 可点击统计卡片 */
.stat-card.clickable, .stat-card-mini.clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.stat-card.clickable:hover, .stat-card-mini.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-card.clickable:active, .stat-card-mini.clickable:active {
    transform: scale(0.98);
}

/* 待处理卡片红色高亮 */
.stat-card[data-status="待处理"] .stat-icon { background: #FFF1F0 !important; color: #FF4D4F !important; }
.stat-card[data-status="待处理"] .stat-value { color: #FF4D4F; }

/* 已完成取货卡片绿色高亮 */
.stat-card[data-status="已完成取货"] .stat-icon { background: #F6FFED !important; color: #52C41A !important; }
.stat-card[data-status="已完成取货"] .stat-value { color: #52C41A; }

/* 当前筛选提示条 */
.active-filter-bar {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 8px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--primary);
}

.active-filter-bar .clear-filter {
    cursor: pointer;
    color: #FF4D4F;
    font-size: 12px;
    user-select: none;
}

.active-filter-bar .clear-filter:active { opacity: 0.7; }

/* 复制按钮 */
.copy-btn {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    user-select: none;
    margin-left: 4px;
}

.copy-btn:active {
    transform: scale(0.95);
    background: var(--primary);
    color: #fff;
}

/* 提报人选择弹窗 */
.submitter-picker-modal .modal-box { max-width: 420px; }
.submitter-pick-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.submitter-pick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    border-radius: 8px;
    background: #F7F8FA;
    cursor: pointer;
    transition: all 0.2s;
}
.submitter-pick-item:hover { background: var(--primary-light); }
.submitter-pick-item:active { transform: scale(0.95); }
.submitter-pick-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}
.submitter-pick-name {
    font-size: 13px;
    color: #333;
}

/* ==================== 筛选栏 ==================== */

.filter-bar {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .filter-input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #FAFBFC;
    transition: border-color 0.2s;
    min-width: 160px;
}

.filter-bar .filter-input:focus { border-color: var(--primary); background: #fff; }

.filter-bar select.filter-input {
    cursor: pointer;
    padding-right: 28px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-bar .btn-filter {
    height: 36px;
    padding: 0 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.filter-bar .btn-reset {
    height: 36px;
    padding: 0 16px;
    background: #fff;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* ==================== 订单表格 (PC) ==================== */

.order-table-wrap {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table thead {
    background: #FAFAFA;
}

.order-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.order-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid #F5F5F5;
    vertical-align: top;
}

.order-table tr:hover td { background: #E8F2FC; }
.order-table tr:hover { box-shadow: inset 3px 0 0 var(--primary); }
.order-table tr { transition: background 0.15s; }

.order-table .customer-cell { font-weight: 600; min-width: 100px; }
.order-table .phone-cell { color: var(--text-hint); font-size: 12px; }
.order-table .submitter-cell { white-space: nowrap; min-width: 70px; }
.order-table .info-cell { min-width: 200px; max-width: 320px; word-break: break-all; }
.order-table .info-cell .info-text { display: inline; }
.order-table .remark-cell { max-width: 120px; color: var(--text-hint); word-break: break-all; }
.order-table .time-cell { color: var(--text-hint); font-size: 12px; white-space: nowrap; min-width: 80px; }

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-tag.status-pending    { background: #FFF1F0; color: #CF1322; }
.status-tag.status-shortage   { background: #FFF7E6; color: #D46B08; }
.status-tag.status-shipping   { background: #E6F7FF; color: #096DD9; }
.status-tag.status-arrived    { background: #E6FFFB; color: #08979C; }
.status-tag.status-notified   { background: #F9F0FF; color: #531DAB; }
.status-tag.status-done       { background: #F6FFED; color: #389E0D; }
.status-tag.status-other      { background: #F5F5F5; color: #8C8C8C; }
.status-tag.status-default    { background: #F0F0F0; color: #666; }

/* 表格行状态色（左侧边框） */
.order-table tr.status-pending td:first-child    { border-left: 3px solid #FF4D4F; }
.order-table tr.status-shortage td:first-child   { border-left: 3px solid #FA8C16; }
.order-table tr.status-shipping td:first-child   { border-left: 3px solid #1890FF; }
.order-table tr.status-arrived td:first-child    { border-left: 3px solid #13C2C2; }
.order-table tr.status-notified td:first-child   { border-left: 3px solid #722ED1; }
.order-table tr.status-done td:first-child       { border-left: 3px solid #52C41A; }
.order-table tr.status-other td:first-child      { border-left: 3px solid #BFBFBF; }
.order-table tr.status-default td:first-child    { border-left: 3px solid #BFBFBF; }

/* 移动端卡片状态色（左侧边框） */
.mobile-order-card.status-pending    { border-left: 3px solid #FF4D4F; }
.mobile-order-card.status-shortage   { border-left: 3px solid #FA8C16; }
.mobile-order-card.status-shipping   { border-left: 3px solid #1890FF; }
.mobile-order-card.status-arrived    { border-left: 3px solid #13C2C2; }
.mobile-order-card.status-notified   { border-left: 3px solid #722ED1; }
.mobile-order-card.status-done       { border-left: 3px solid #52C41A; }
.mobile-order-card.status-other      { border-left: 3px solid #BFBFBF; }
.mobile-order-card.status-default    { border-left: 3px solid #BFBFBF; }

/* 操作按钮 */
.btn-action {
    padding: 4px 12px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action:hover { background: var(--primary); color: #fff; }

/* ==================== 订单卡片 (移动端) ==================== */

.mobile-order-list { display: none; }

.mobile-order-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
}

.mobile-order-card:hover, .mobile-order-card:active {
    background: #F0F7FF;
    box-shadow: 0 4px 16px rgba(74,144,217,0.15);
    transform: translateY(-1px);
}

.mobile-order-card .card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.mobile-order-card .customer-info-block { flex: 1; min-width: 0; }
.mobile-order-card .customer-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.mobile-order-card .customer-name { font-size: 15px; font-weight: 600; }
.mobile-order-card .customer-phone { display: block; font-size: 12px; color: var(--text-hint); margin-top: 2px; }

.mobile-order-card .info-row {
    display: flex;
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.5;
}

.mobile-order-card .info-row .label {
    flex-shrink: 0;
    width: 60px;
    color: var(--text-hint);
}

.mobile-order-card .info-row .value {
    flex: 1;
    word-break: break-all;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
}

.mobile-order-card .info-row .value .info-text { flex: 1; min-width: 0; }

.mobile-order-card .card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #F5F5F5;
}

.mobile-order-card .card-time { font-size: 12px; color: var(--text-hint); }

/* ==================== 分页 ==================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
}

.pagination button {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-hint);
    margin: 0 8px;
}

/* ==================== 状态更新弹窗 ==================== */

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-mask.show { display: flex; }

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

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s ease;
}

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

.modal-header {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    font-size: 20px;
    color: var(--text-hint);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 4px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .detail-row {
    display: flex;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #F5F5F5;
}

.modal-body .detail-row:last-child { border-bottom: none; }
.modal-body .detail-label { flex-shrink: 0; width: 80px; color: var(--text-hint); }
.modal-body .detail-value { flex: 1; word-break: break-all; }

/* 可点击的链接样式（客户姓名、电话等） */
.link-text {
    color: #1677FF;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}
.link-text:hover {
    opacity: 0.8;
    text-decoration: underline;
}
a.link-text {
    text-decoration: none;
}

/* 操作记录 */
.log-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.log-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
}
.log-item {
    padding: 8px 12px;
    background: #F7F8FA;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary);
}
.log-item:last-child { margin-bottom: 0; }
.log-item-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.log-user {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}
.log-tag {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.log-tag-admin { background: #FFF7E6; color: #D48806; }
.log-tag-staff { background: #E6F7FF; color: #1890FF; }
.log-time {
    font-size: 12px;
    color: var(--text-hint);
    margin-left: auto;
}
.log-item-action {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.log-item-action b { color: var(--text-main); font-weight: 600; }
.log-item-remark {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 2px;
}
.log-empty {
    font-size: 13px;
    color: var(--text-hint);
    text-align: center;
    padding: 12px 0;
}

.modal-body .form-group { margin-top: 16px; }

.modal-body select.form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background: #FAFBFC;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.modal-body textarea.form-input {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    background: #FAFBFC;
}

/* 详情弹窗分区 */
.detail-section {
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid #F0F0F0;
}
.detail-section:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}
.detail-section-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-section-header::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

/* 状态修改表单卡片 */
.status-form-card {
    background: #F7F8FA;
    border: 1px solid #ECEEF2;
    border-radius: 8px;
    padding: 14px;
}
.status-form-card .form-group {
    margin: 0 0 10px 0;
}
.status-form-card .form-group:last-child {
    margin-bottom: 0;
}
.status-form-card .form-label {
    margin-bottom: 4px;
}
.status-form-card select.form-input {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 12px;
    border: 1.5px solid #E0E3E8;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.status-form-card select.form-input:focus {
    border-color: var(--primary);
}
.status-form-card textarea.form-input {
    width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border: 1.5px solid #E0E3E8;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    background: #fff;
    line-height: 1.5;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
}

.btn-confirm {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-confirm:disabled { opacity: 0.6; }

/* ==================== 空状态 ==================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-hint);
}

.empty-state svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: 0.3; }
.empty-state .empty-text { font-size: 14px; }

/* ==================== 状态切换按钮 ==================== */

.status-edit-btn {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    font-size: 12px;
    color: var(--primary);
    background: #E6F4FF;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.status-edit-btn:hover { background: #BAE0FF; }

.status-edit-btn-large {
    display: inline-block;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.status-edit-btn-large:hover { opacity: 0.85; }
.status-edit-btn-large:active { transform: scale(0.96); }

/* ==================== 九宫格状态选择弹窗 ==================== */

.status-grid-modal .modal-box {
    max-width: 420px;
}

.status-grid-current {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    text-align: center;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.status-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    border-radius: 12px;
    background: #F7F8FA;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 80px;
}

.status-grid-item:active { transform: scale(0.95); }

.status-grid-item.selected {
    background: #E6F4FF;
    border-color: var(--primary);
}

.status-grid-item.current {
    background: #F0F0F0;
    opacity: 0.6;
}

.status-grid-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.status-grid-text {
    font-size: 13px;
    color: #333;
    text-align: center;
    line-height: 1.3;
    word-break: break-all;
}

.status-grid-item.selected .status-grid-text {
    color: var(--primary);
    font-weight: 600;
}

.status-grid-check {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
}

.status-grid-remark-wrap {
    margin-top: 16px;
}

.status-grid-remark-wrap .form-label {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.status-grid-remark-wrap textarea {
    width: 100%;
    min-height: 70px;
    padding: 12px;
    font-size: 14px;
    border: 1px solid #E0E3E8;
    border-radius: 8px;
    resize: none;
}

/* ==================== 入账选择弹窗 ==================== */

.payment-picker-modal .modal-box {
    max-width: 400px;
}

.payment-toggle-wrap {
    display: flex;
    gap: 12px;
}

.payment-option {
    flex: 1;
    text-align: center;
    padding: 18px 0;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    background: #FAFBFC;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.payment-option:active { transform: scale(0.97); }

.payment-option.active[data-value="未入账"] {
    border-color: #FA8C16;
    background: #FFF7E6;
    color: #D46B08;
    font-weight: 600;
}

.payment-option.active[data-value="已入账"] {
    border-color: #52C41A;
    background: #F6FFED;
    color: #389E0D;
    font-weight: 600;
}

/* ==================== 响应式 ==================== */

@media (max-width: 768px) {
    .admin-topbar { padding: 0 12px; height: 48px; }
    .admin-topbar .logo { font-size: 13px; gap: 6px; }
    .admin-topbar .logo svg { width: 20px; height: 20px; }
    .admin-topbar .user-info { gap: 10px; font-size: 12px; }
    .admin-topbar .user-info .user-name { display: none; }
    .admin-topbar .btn-logout { padding: 5px 10px; font-size: 12px; }

    .admin-body { padding: 10px; }

    /* Tab导航 */
    .admin-tabs { padding: 0 4px; margin-bottom: 12px; }
    .admin-tab { padding: 8px 14px; font-size: 14px; }

    /* 统计卡片 - 顶部5个 */
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
    .stat-card { padding: 12px 10px; gap: 10px; }
    .stat-card .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
    .stat-card .stat-icon svg { width: 20px; height: 20px; }
    .stat-card .stat-info .stat-value { font-size: 20px; }
    .stat-card .stat-info .stat-label { font-size: 11px; }

    /* 时间段统计 - 6个，3列 */
    .stats-time { grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
    .stat-card-mini { padding: 10px 6px; }
    .stat-card-mini .stat-value { font-size: 18px; }
    .stat-card-mini .stat-label { font-size: 11px; }

    /* 当前筛选提示条 */
    .active-filter-bar { padding: 6px 12px; font-size: 12px; margin-bottom: 8px; }
    .active-filter-bar .clear-filter { font-size: 11px; }

    /* 筛选栏 */
    .filter-bar { padding: 10px; gap: 6px; flex-wrap: wrap; }
    .filter-bar .filter-input { min-width: 0; flex: 1 1 calc(50% - 3px); height: 34px; font-size: 12px; padding: 0 10px; }
    .filter-bar .filter-input::placeholder { font-size: 12px; }
    .filter-bar select.filter-input { flex: 1 1 100%; }
    .filter-bar .btn-filter, .filter-bar .btn-reset { height: 34px; padding: 0 14px; font-size: 12px; flex-shrink: 0; }
    .filter-bar #btn-refresh { flex: 1 1 100%; }

    /* PC表格隐藏，移动端卡片显示 */
    .order-table-wrap { display: none; }
    .mobile-order-list { display: block; }

    /* 移动端订单卡片优化 */
    .mobile-order-card { padding: 12px 14px; margin-bottom: 8px; }
    .mobile-order-card .card-top { flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
    .mobile-order-card .customer-name { font-size: 14px; }
    .mobile-order-card .customer-phone { display: block; font-size: 12px; margin-top: 2px; }
    .mobile-order-card .info-row { font-size: 12px; margin-bottom: 3px; }
    .mobile-order-card .info-row .label { width: 56px; flex-shrink: 0; }
    .mobile-order-card .card-bottom { margin-top: 6px; padding-top: 6px; }

    /* 弹窗优化 */
    .modal-box { width: 94%; max-height: 82vh; }
    .modal-header { padding: 12px 16px; font-size: 15px; }
    .modal-body { padding: 14px; }
    .modal-body .detail-row { font-size: 12px; padding: 5px 0; }
    .modal-body .detail-label { width: 70px; }
    .modal-footer { padding: 10px 16px; }
    .btn-cancel, .btn-confirm { padding: 7px 16px; font-size: 13px; }

    /* 状态修改弹窗内表单 */
    .status-form-card { padding: 10px; }
    .status-form-card select.form-input { height: 38px; font-size: 13px; }
    .status-form-card textarea.form-input { min-height: 56px; font-size: 13px; }

    /* 九宫格状态选择弹窗 */
    .status-grid-modal .modal-box { max-width: 94%; }
    .status-grid { gap: 8px; }
    .status-grid-item { min-height: 68px; padding: 12px 4px; }
    .status-grid-text { font-size: 12px; }
    .status-grid-dot { width: 10px; height: 10px; margin-bottom: 6px; }
    .status-grid-remark-wrap textarea { min-height: 56px; font-size: 13px; padding: 10px; }

    /* 入账选择弹窗 */
    .payment-picker-modal .modal-box { max-width: 94%; }
    .payment-option { padding: 16px 0; font-size: 15px; }

    /* 用户编辑弹窗适配 */
    .user-editor-modal .form-input { height: 40px; font-size: 14px; }

    /* 分页 */
    .pagination { gap: 4px; padding: 14px 0; }
    .pagination button { min-width: 28px; height: 28px; padding: 0 8px; font-size: 12px; }
    .pagination .page-info { font-size: 12px; margin: 0 4px; }

    /* 用户管理 */
    .mobile-user-list { display: block; }
    .user-table-wrap { display: none; }
    .user-toolbar { margin-bottom: 12px; }
    .btn-add-user { padding: 8px 16px; font-size: 13px; }

    .mobile-user-card { padding: 12px 14px; margin-bottom: 8px; }
    .mobile-user-card .user-card-top { margin-bottom: 8px; }
    .mobile-user-card .user-avatar { width: 36px; height: 36px; font-size: 15px; margin-right: 10px; }
    .mobile-user-card .user-card-name { font-size: 14px; }
    .mobile-user-card .user-card-phone { font-size: 12px; }
    .mobile-user-card .user-card-tags { gap: 4px; margin-bottom: 8px; }
    .mobile-user-card .user-card-time { font-size: 11px; }
    .mobile-user-card .user-card-actions { gap: 6px; }
    .mobile-user-card .btn-action { font-size: 11px; padding: 3px 10px; }

    /* 提报人选择弹窗 */
    .submitter-picker-modal .modal-box { max-width: 94%; }
    .submitter-pick-list { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .submitter-pick-item { padding: 8px 4px; }
    .submitter-pick-avatar { width: 32px; height: 32px; font-size: 14px; }
    .submitter-pick-name { font-size: 12px; }

    /* 标签缩小 */
    .role-tag, .jiahong-tag { font-size: 11px; padding: 2px 8px; }
    .status-tag { font-size: 11px; padding: 2px 8px; }

    /* 空状态 */
    .empty-state { padding: 40px 16px; }

    /* 加急标签 */
    .urgent-badge { font-size: 10px; padding: 1px 5px; margin-left: 4px; }

    /* 复制按钮 */
    .copy-btn { font-size: 10px; padding: 1px 6px; }
}

/* 超小屏幕适配 (320px-375px) */
@media (max-width: 375px) {
    .admin-topbar .logo { font-size: 12px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .stat-card { padding: 10px 8px; gap: 8px; }
    .stat-card .stat-icon { width: 32px; height: 32px; border-radius: 8px; }
    .stat-card .stat-icon svg { width: 18px; height: 18px; }
    .stat-card .stat-info .stat-value { font-size: 18px; }
    .stat-card .stat-info .stat-label { font-size: 10px; }

    .stats-time { gap: 4px; }
    .stat-card-mini { padding: 8px 4px; }
    .stat-card-mini .stat-value { font-size: 16px; }
    .stat-card-mini .stat-label { font-size: 10px; }

    .filter-bar .filter-input { flex: 1 1 100%; }

    .mobile-order-card { padding: 10px 12px; }
    .mobile-order-card .info-row .label { width: 52px; }

    .submitter-pick-list { grid-template-columns: repeat(3, 1fr); }
}

/* 加急标签 */
.urgent-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #FF4D4F;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* 入账标签 */
.payment-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 2px;
}
.payment-tag.paid {
    background: #F6FFED;
    color: #52C41A;
    border: 1px solid #D9F7BE;
}
.payment-tag.unpaid {
    background: #FFF7E6;
    color: #FA8C16;
    border: 1px solid #FFE7BA;
}

/* 入账操作日志标签 */
.log-tag-payment {
    background: #F9F0FF;
    color: #722ED1;
}

/* ==================== 用户管理 ==================== */
.user-toolbar {
    margin-bottom: 16px;
}

.btn-add-user {
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-user:hover { background: var(--primary-dark); }
.btn-add-user:active { transform: scale(0.97); }

.user-table .user-name-cell { font-weight: 600; min-width: 80px; }

.role-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.role-tag.role-admin { background: #FFF7E6; color: #FA8C16; }
.role-tag.role-staff { background: #E6F7FF; color: #1890FF; }
.role-tag.role-super { background: linear-gradient(135deg, #722ED1, #9254DE); color: #fff; }

.jiahong-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.jiahong-tag.jiahong-yes { background: #F6FFED; color: #52C41A; }
.jiahong-tag.jiahong-no { background: #F5F5F5; color: #999; }

.status-tag.status-on { background: #F6FFED; color: #52C41A; padding: 2px 10px; border-radius: 4px; font-size: 12px; display: inline-block; }
.status-tag.status-off { background: #FFF1F0; color: #FF4D4F; padding: 2px 10px; border-radius: 4px; font-size: 12px; display: inline-block; }

.btn-action.btn-danger {
    background: #FFF1F0;
    color: #FF4D4F;
    margin-left: 6px;
}

.btn-action.btn-danger:hover { background: #FF4D4F; color: #fff; }

/* 用户编辑弹窗 */
.user-editor-modal { max-width: 400px; }
.user-editor-modal .form-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: #FAFBFC;
    transition: border-color 0.2s;
}
.user-editor-modal select.form-input {
    cursor: pointer;
    appearance: none;
    padding-right: 28px;
    background: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.user-editor-modal .form-input:focus { border-color: var(--primary); background: #fff; }
.form-hint { font-size: 12px; color: var(--text-hint); margin-top: 4px; line-height: 1.4; }

/* 移动端用户卡片 */
.mobile-user-list { display: none; }

.mobile-user-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.mobile-user-card .user-card-top {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.mobile-user-card .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.mobile-user-card .user-card-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.mobile-user-card .user-card-phone {
    font-size: 13px;
    color: var(--text-hint);
}

.mobile-user-card .user-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    align-items: center;
}

.mobile-user-card .user-card-time {
    font-size: 12px;
    color: var(--text-hint);
    margin-left: auto;
}

.mobile-user-card .user-card-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .mobile-user-list { display: block; }
    .user-table-wrap { display: none; }
}
