* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
}

/* ============ 顶部导航 ============ */
.navbar {
    background: #1890ff;
    color: white;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 20px;
    font-weight: bold;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user span {
    font-size: 14px;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: 1px solid white;
    color: white;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* ============ 主容器 ============ */
.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ============ 侧边栏 ============ */
.sidebar {
    width: 200px;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.menu {
    list-style: none;
}

.menu-item {
    padding: 15px 20px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.menu-item:hover {
    background: #f0f0f0;
    border-left-color: #1890ff;
}

.menu-item.active {
    background: #e6f7ff;
    border-left-color: #1890ff;
    color: #1890ff;
}

/* ============ 主内容区 ============ */
.main-content {
    flex: 1;
    padding: 20px;
}

.page-header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 24px;
    color: #333;
}

.page-header p {
    color: #666;
    margin-top: 5px;
}

/* ============ 统计卡片 ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.stat-card-title {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card-value {
    font-size: 30px;
    font-weight: bold;
    color: #333;
}

.stat-card-desc {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* ============ 内容卡片 ============ */
.content-card {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow-x: auto;   /* 添加这一行，当表格宽度超出时显示横向滚动条 */
}

.content-card h2 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* ============ 搜索筛选区 ============ */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.filter-item label {
    font-size: 12px;
    color: #666;
}

.filter-item input,
.filter-item select {
    padding: 3px 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #1890ff;
}

/* ============ 按钮 ============ */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

/* ============ 表格 ============ */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: #fafafa;
}

/* ============ 状态标签 ============ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
}

.badge-success {
    background: #52c41a;
    color: white;
}

.badge-warning {
    background: #faad14;
    color: white;
}

.badge-error {
    background: #ff4d4f;
    color: white;
}

.badge-info {
    background: #1890ff;
    color: white;
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 4px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    gap: 10px;
}

/* ============ 加载动画 ============ */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

        /* ============ 统计表格样式 ============ */
.stats-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    font-size: 13px;
}

.stats-table th,
.stats-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid #e8e8e8;
    white-space: nowrap;
}

.stats-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.stats-table thead tr:first-child th {
    background: #1890ff;
    color: white;
}

.stats-table tbody tr:hover {
    background: #f5f5f5;
}

.stats-table .sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    text-align: left;
    font-weight: 600;
    min-width: 100px;
}

.stats-table thead .sticky-col {
    background: #1890ff;
    color: white;
    z-index: 2;
}

.stats-table thead tr:nth-child(2) .sticky-col {
    background: #fafafa;
    color: #333;
}

.stats-table .summary-row {
    background: #fffbe6;
}

.stats-table .summary-row td {
    border-top: 2px solid #1890ff;
}

.stats-table .summary-row .sticky-col {
    background: #fffbe6;
}

/* ============ 标题行内筛选样式 ============ */
.header-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-filters .filter-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-filters .filter-item label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.header-filters .filter-item input[type="date"] {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 130px;
}

.header-filters .filter-item input:focus {
    outline: none;
    border-color: #1890ff;
}

/* ============ 页面切换 ============ */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* ============ 弹窗 ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============ 表单 ============ */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1890ff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ============ 图片上传 ============ */
.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-upload-area:hover {
    border-color: #1890ff;
}

.image-upload-area.uploading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============ 菜品缩略图 ============ */
.dish-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    background: #f5f5f5;
}

.dish-thumb-placeholder {
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 20px;
}

/* 导出按钮样式 */
.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-success:disabled {
    background: #b7eb8f;
    cursor: not-allowed;
}

/* ============================================================================
⭐ 写单板相关样式
============================================================================ */

/* 头部操作按钮 */
.header-actions {
    display: flex;
    gap: 10px;
}

/* 自动补全下拉框 */
/* 自动补全下拉框 - 自适应高度 */
/* 自动补全下拉框 - 跟随光标 */
.autocomplete-dropdown {
    position: fixed;  /* 改为 fixed 定位 */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-height: 300px;
    min-width: 200px;
    max-width: 300px;
    overflow: hidden;
}

.autocomplete-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1890ff;
    color: white;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px 8px 0 0;
}

.autocomplete-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: white;
    padding: 0;
    line-height: 1;
}

.autocomplete-body {
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.autocomplete-item:hover {
    background: #e6f7ff;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item-name {
    font-size: 14px;
    color: #333;
}

.autocomplete-item-price {
    font-size: 13px;
    color: #ff6b00;
    font-weight: 600;
    margin-left: 10px;
}

.autocomplete-item-info {
    font-size: 12px;
    color: #999;
}

/* 帮助说明框 */
.help-box {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.help-box h4 {
    margin: 0 0 10px 0;
    color: #d48806;
    font-size: 14px;
}

.help-box ul {
    margin: 0;
    padding-left: 20px;
}

.help-box li {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    line-height: 1.5;
}

.help-box strong {
    color: #333;
}

/* 预览统计 */
.preview-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #fafafa;
    border-radius: 8px;
}

.stat-item {
    font-size: 14px;
    color: #666;
}

.stat-item strong {
    font-size: 18px;
    margin-left: 5px;
}

.stat-success strong {
    color: #52c41a;
}

.stat-error strong {
    color: #ff4d4f;
}

.stat-amount strong {
    color: #1890ff;
}

/* 预览表格 */
.preview-table {
    font-size: 13px;
}

.preview-table th {
    background: #fafafa;
    font-size: 12px;
    padding: 8px 10px;
}

.preview-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.preview-table .row-success {
    background: #f6ffed;
}

.preview-table .row-error {
    background: #fff2f0;
}

.preview-table .error-msg {
    color: #ff4d4f;
    font-size: 12px;
}

.preview-table .raw-line {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #666;
}

/* 进度条 */
.progress-icon {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1890ff, #52c41a);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    color: #666;
    font-size: 14px;
}

/* 补全列表中的更多提示 */
.autocomplete-more {
    padding: 10px 15px;
    text-align: center;
    color: #999;
    font-size: 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

/* 用户信息显示区域 */
.user-info {
    font-size: 13px;
    color: #fff;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 20px;
    margin-right: 15px;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 500px;
}
.user-info span {
    margin: 0 2px;
}
/* 小屏幕适配：允许换行或缩小字体 */
@media (max-width: 1200px) {
    .user-info {
        font-size: 12px;
        max-width: 400px;
    }
}
@media (max-width: 900px) {
    .user-info {
        font-size: 11px;
        max-width: 300px;
    }
}

/* 突出显示“送餐点”下拉框 */
#filter-delivery-point {
    font-size: 14px !important;
    font-weight: bold !important;
    border: 2px solid #1890ff !important;
    background-color: #f0f9ff !important;
    border-radius: 6px !important;
    padding: 5px 8px !important;
}

/* 突出显示“配送时间”下拉框（时段筛选） */
#filter-delivery-time {
    font-size: 14px !important;
    font-weight: bold !important;
    border: 2px solid #52c41a !important;
    background-color: #f6ffed !important;
    border-radius: 6px !important;
    padding: 5px 8px !important;
}

/* 同时让这两个下拉框的 label 也突出显示（可选） */
label[for="filter-delivery-point"],
label[for="filter-delivery-time"] {
    font-weight: bold;
    color: #1890ff;
}