/* 蛋蛋助农站后台自定义样式 */
:root {
    --dd-primary: #1677ff;
    --dd-primary-dark: #0b5ed7;
    --dd-green: #16a34a;
    --dd-text: #1f2937;
    --dd-muted: #6b7280;
    --dd-line: #e5e7eb;
    --dd-bg: #f6f8fb;
    --dd-card: #ffffff;
    --dd-radius: 12px;
}

.dd-form {
    background: var(--dd-bg);
    min-height: 100%;
    padding: 18px 18px 0;
    box-sizing: border-box;
}
.dd-form-body { max-width: 1180px; margin: 0 auto; }
.dd-form .layui-input,
.dd-form .layui-select,
.dd-form textarea {
    height: 38px;
    border-color: #dfe4ec;
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.dd-form .layui-input:focus,
.dd-form .layui-input:hover { border-color: var(--dd-primary) !important; box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.dd-form .layui-form-select dl { border-radius: 8px; }
.dd-form .help-label { margin-bottom: 7px; display: block; }
.dd-form .help-label b { font-size: 13px; color: var(--dd-text) !important; font-weight: 600; }
.dd-form .help-block { color: #98a2b3; font-size: 12px; line-height: 1.7; margin-top: 4px; display: block; }

.dd-section {
    background: var(--dd-card);
    border: 1px solid var(--dd-line);
    border-radius: var(--dd-radius);
    padding: 18px 22px 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.dd-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px dashed var(--dd-line);
}
.dd-section-head > div { display: flex; align-items: baseline; gap: 10px; }
.dd-section-head b { font-size: 16px; color: var(--dd-text); font-weight: 600; }
.dd-section-head small { color: #98a2b3; font-size: 12px; }
.dd-section-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg,#e8f1ff,#d8e8ff);
    color: var(--dd-primary);
    font-size: 12px;
    font-weight: 700;
    transform: translateY(3px);
}
.dd-section-tip { color: #98a2b3; font-size: 12px; }
.dd-section-tip i { color: #f04438; font-style: normal; }

.dd-form-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 0 18px;
    display: flex;
    gap: 10px;
    justify-content: center;
    background: linear-gradient(180deg, rgba(246,248,251,0), var(--dd-bg) 35%);
}
.dd-form-footer .layui-btn { min-width: 132px; height: 40px; line-height: 40px; border-radius: 8px; font-size: 14px; }

/* 弹窗表单高度自适应：只限制最大高度，短表单不再留大片空白 */
.layui-layer-page:has(.dd-form) > .layui-layer-content {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* 详情弹窗高度自适应：短内容贴合内容，长内容在弹窗内滚动 */
.layui-layer-page:has(.dd-detail-modal) {
    max-height: calc(100vh - 60px);
}
.layui-layer-page:has(.dd-detail-modal) > .layui-layer-content {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.dd-map-wrap {
    border: 1px solid var(--dd-line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.dd-map { height: 300px; width: 100%; background: #eef2f7; display: flex; align-items: center; justify-content: center; color: #98a2b3; font-size: 13px; }
.dd-map-tools { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 12px; color: #98a2b3; background: #fafbfc; border-top: 1px solid var(--dd-line); }
.dd-map-tools a { color: var(--dd-primary); }

.dd-upload-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; }
.dd-upload-card { background: #fafbfc; border: 1px dashed #d9e0ea; border-radius: 10px; padding: 12px; }
.dd-upload-title { font-size: 13px; color: var(--dd-text); margin-bottom: 8px; font-weight: 600; }
.dd-upload-card .uploadimage {
    width: 100% !important;
    height: 132px !important;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    border: 1px dashed #d9e0ea;
    box-shadow: none;
    transition: border-color .2s ease, background-color .2s ease;
}
.dd-upload-card .uploadimage:hover { border-color: var(--dd-primary); background-color: #f8fbff; }
/* 空态：去掉 ThinkAdmin 自带的 76x76 底图，改用统一的图标 + 文案 */
.dd-upload-card .uploadimage:not([style*="background-image"]) {
    background-image: none !important;
}
.dd-upload-card .uploadimage:not([style*="background-image"])::before {
    content: "+";
    position: absolute;
    left: 0;
    right: 0;
    top: 31px;
    z-index: 1;
    font-family: Arial, sans-serif;
    font-size: 36px;
    font-weight: 300;
    line-height: 1;
    text-align: center;
    color: #b7c2d2;
}
.dd-upload-card .uploadimage:not([style*="background-image"])::after {
    content: "点击上传图片";
    position: absolute;
    left: 0;
    right: 0;
    top: 82px;
    z-index: 1;
    font-size: 12px;
    color: #98a2b3;
    text-align: center;
}
.dd-upload-card .uploadimage:not([style*="background-image"]):hover::before { color: var(--dd-primary); }
.dd-upload-card .uploadimage:not([style*="background-image"]):hover::after { color: var(--dd-primary); }
.dd-upload-card .uploadimage > span:last-child { height: 132px; }
/* hover 工具条挪到右下角，避免和空态图标/文案重叠 */
.dd-upload-card .uploadimage > span:first-child {
    left: auto;
    right: 8px;
    bottom: 8px;
    height: 26px;
    line-height: 26px;
    margin-left: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .18);
}
.dd-upload-card .uploadimage > span:first-child .layui-icon {
    width: 26px;
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    float: none;
    display: inline-block;
}
.dd-upload-card .uploadimage:not([style*="background-image"]) > span:first-child {
    display: none !important;
}
/* 下拉：长列表可滚动，lay-search 搜索框保持紧凑 */
.layui-form-select dl {
    min-height: 0;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    bottom: auto;
}
.layui-form-selected dl { min-height: 0; }
/* 向上弹出时同时保留 top/bottom 会把高度压成 0，这里显式只保留 bottom */
.layui-form-select.layui-form-selectup dl {
    top: auto;
    bottom: 100%;
    margin-bottom: 4px;
}
.layui-form-select dl::-webkit-scrollbar { width: 8px; height: 8px; }
.layui-form-select dl::-webkit-scrollbar-thumb { background: #9aa8bd; border-radius: 8px; border: 2px solid #f3f6fa; }
.layui-form-select dl::-webkit-scrollbar-track { background: #f3f6fa; }
.layui-form-select .layui-input { height: 34px; line-height: 34px; }

/* 员工页 */
.dd-page { background: var(--dd-bg); padding: 18px; min-height: 100vh; box-sizing: border-box; }
.dd-page-card { background: #fff; border: 1px solid var(--dd-line); border-radius: var(--dd-radius); padding: 18px 20px; margin-bottom: 16px; }
.dd-page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dd-page-head h3 { font-size: 17px; color: var(--dd-text); font-weight: 600; }
.dd-page-head .dd-store-name { color: var(--dd-primary); }
.dd-page-card .layui-table { margin: 0; }
.dd-page-card .layui-table th { background: #f8fafc; color: #475467; font-weight: 600; }
.dd-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; line-height: 20px; }
.dd-badge-green { color: #067647; background: #ecfdf3; }
.dd-badge-gray { color: #667085; background: #f2f4f7; }
.dd-inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.dd-inline-form .dd-field { flex: 1 1 150px; min-width: 130px; }
.dd-inline-form .dd-field label { display: block; font-size: 12px; color: #667085; margin-bottom: 5px; }
.dd-inline-form .layui-input { height: 36px; border-radius: 8px; }
.dd-inline-form select { width: 100%; height: 36px; border: 1px solid #dfe4ec; border-radius: 8px; padding: 0 8px; background: #fff; color: var(--dd-text); }
.dd-inline-form .layui-btn { height: 36px; line-height: 36px; border-radius: 8px; }

/* 代理表单 */
.dd-agent-form .dd-section-head small { display: inline-block; }
.dd-money-input { position: relative; }
.dd-money-input .layui-input { padding-right: 44px; }
.dd-money-input em { position: absolute; right: 12px; top: 0; line-height: 38px; color: #98a2b3; font-style: normal; font-size: 13px; }

@media (max-width: 900px) {
    .dd-upload-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .dd-section { padding: 16px 14px 6px; }
    .dd-form { padding: 12px 10px 0; }
}

/* 代理提现 / 结算报表 */
.dd-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; padding: 16px 16px 6px; }
.dd-kpi-card { position: relative; background: #fff; border: 1px solid var(--dd-line); border-radius: 12px; padding: 15px 18px 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.dd-kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #1677ff; }
.dd-kpi-blue::before { background: #1677ff; }
.dd-kpi-cyan::before { background: #06b6d4; }
.dd-kpi-green::before { background: #16a34a; }
.dd-kpi-violet::before { background: #8b5cf6; }
.dd-kpi-amber::before { background: #f59e0b; }
.dd-kpi-red::before { background: #ef4444; }
.dd-kpi-label { font-size: 12px; color: #667085; letter-spacing: .2px; }
.dd-kpi-value { margin-top: 7px; font-size: 25px; line-height: 1.1; font-weight: 600; color: #101828; font-variant-numeric: tabular-nums; }
.dd-kpi-value small { margin-left: 3px; font-size: 12px; font-weight: 400; color: #98a2b3; }
.dd-kpi-value.dd-kpi-small { font-size: 17px; line-height: 1.5; }
.dd-kpi-sub { margin-top: 7px; font-size: 12px; color: #98a2b3; line-height: 1.5; }
.dd-kpi-red .dd-kpi-value { color: #d92d20; }

.dd-tab-nav { display: flex; gap: 6px; margin: 2px 16px 0; padding: 0 2px; border-bottom: 1px solid var(--dd-line); }
.dd-tab-btn { position: relative; border: 0; background: transparent; padding: 12px 18px 13px; font-size: 14px; color: #667085; cursor: pointer; border-radius: 8px 8px 0 0; transition: color .15s, background .15s; }
.dd-tab-btn:hover { color: var(--dd-primary); background: #f5f9ff; }
.dd-tab-btn.active { color: var(--dd-primary); font-weight: 600; }
.dd-tab-btn.active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--dd-primary); border-radius: 2px 2px 0 0; }
.dd-tab-panel { display: none; padding: 16px; }
.dd-tab-panel.active { display: block; }

.dd-report { background: var(--dd-bg); min-height: calc(100vh - 60px); padding-bottom: 10px; }
.dd-report-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 16px 16px 0; padding: 20px 24px; border-radius: 14px; border: 1px solid #dbeafe; background: linear-gradient(120deg, #f0f7ff 0%, #f7fbff 55%, #f2fbf7 100%); }
.dd-report-hero h2 { margin: 0; font-size: 20px; color: #0f172a; font-weight: 600; letter-spacing: .2px; }
.dd-report-hero p { margin: 7px 0 0; font-size: 12px; color: #667085; }
.dd-report-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.dd-report-hero-tags span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: rgba(255,255,255,.78); border: 1px solid #e2eaf5; font-size: 12px; color: #475467; white-space: nowrap; }
.dd-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.dd-dot-green { background: #22c55e; }
.dd-dot-blue { background: #1677ff; }
.dd-dot-red { background: #ef4444; }
.dd-dot-amber { background: #f59e0b; }

.dd-report-toolbar { margin: 0 0 14px; }
.dd-report-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: #fff; border: 1px solid var(--dd-line); border-radius: 12px; }
.dd-filter-label { font-size: 13px; color: #475467; font-weight: 500; margin-right: 2px; }
.dd-filter-sep { color: #98a2b3; font-size: 12px; }
.dd-filter-hint { color: #98a2b3; font-size: 12px; margin-left: 4px; }
.dd-date-input { width: 140px; height: 34px; line-height: 34px; border-radius: 8px; border-color: #dfe4ec; }
.dd-report-filter .layui-btn { height: 34px; line-height: 34px; border-radius: 8px; }
.dd-quick-sep { width: 1px; height: 20px; background: var(--dd-line); margin: 0 4px; }
.dd-quick-btn { border: 1px solid #e2e8f0; background: #fff; color: #475467; height: 30px; padding: 0 12px; border-radius: 99px; font-size: 12px; cursor: pointer; transition: all .15s; }
.dd-quick-btn:hover { color: var(--dd-primary); border-color: #bcd7ff; background: #f5f9ff; }

.dd-chart-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 14px; margin-bottom: 14px; }
.dd-chart-grid-reconcile { grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }
.dd-chart-card { padding-bottom: 8px; }
.dd-chart { width: 100%; height: 300px; }
.dd-panel { background: #fff; border: 1px solid var(--dd-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.03); margin-bottom: 14px; overflow: hidden; }
.dd-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px 12px; border-bottom: 1px solid #f1f4f9; }
.dd-panel-head > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.dd-panel-head b { font-size: 15px; color: #1f2937; font-weight: 600; white-space: nowrap; }
.dd-panel-head small { font-size: 12px; color: #98a2b3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-panel-tag { flex: none; font-size: 12px; color: #667085; background: #f5f8fc; border: 1px solid #e8eef7; border-radius: 99px; padding: 3px 9px; }
.dd-table-scroll { overflow-x: auto; }
.dd-table-scroll::-webkit-scrollbar { height: 8px; }
.dd-table-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.dd-report-table { margin: 0; min-width: 960px; }
.dd-report-table thead th { background: #f8fafc; color: #475467; font-weight: 600; font-size: 12px; white-space: nowrap; border-bottom: 1px solid #eef2f7; }
.dd-report-table tbody td { color: #344054; font-size: 12.5px; padding: 9px 10px; border-bottom: 1px solid #f1f4f9; font-variant-numeric: tabular-nums; }
.dd-report-table tbody tr:hover { background: #fbfdff; }
.dd-report-table tfoot td { background: #fbfcfe; color: #1f2937; font-weight: 600; font-size: 12.5px; padding: 10px; border-top: 1px solid #eef2f7; }
.dd-report-note { padding: 10px 18px 12px; font-size: 12px; color: #98a2b3; line-height: 1.6; background: #fff; }
.dd-num-green { color: #16a34a; }
.dd-num-red { color: #d92d20; }
.dd-num-gray { color: #98a2b3; }
.dd-empty { padding: 26px 10px; text-align: center; color: #98a2b3; font-size: 13px; }
.dd-empty-ok { color: #16a34a; }
.dd-empty-ok .layui-icon { margin-right: 5px; font-size: 15px; }

.dd-reconcile-table { margin: 0; }
.dd-reconcile-table th { background: #f8fafc; color: #475467; font-size: 12px; font-weight: 600; }
.dd-reconcile-table td { font-size: 12.5px; padding: 9px 12px; color: #344054; font-variant-numeric: tabular-nums; }
.dd-reconcile-tips { padding: 10px 16px 14px; }
.dd-reconcile-tips p { margin: 5px 0; font-size: 12px; color: #667085; line-height: 1.6; }
.dd-reconcile-tips .dd-dot { margin-right: 4px; transform: translateY(-1px); }
.dd-status-ok, .dd-status-warn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; }
.dd-status-ok { color: #067647; background: #ecfdf3; border: 1px solid #d1fadf; }
.dd-status-warn { color: #b54708; background: #fffaeb; border: 1px solid #fedf89; }
.dd-badge-blue { color: #175cd3; background: #eff8ff; }

.dd-wallet-strip { display: flex; flex-wrap: wrap; gap: 28px; padding: 15px 18px; margin-bottom: 8px; background: linear-gradient(120deg,#f0f7ff,#f8fbff); border: 1px solid #dbeafe; border-radius: 10px; }
.dd-wallet-strip > div { display: flex; flex-direction: column; gap: 4px; }
.dd-wallet-strip span { font-size: 12px; color: #667085; }
.dd-wallet-strip b { font-size: 24px; line-height: 1.2; color: #0f172a; font-variant-numeric: tabular-nums; }
.dd-wallet-strip em { font-style: normal; font-size: 12px; color: #475467; line-height: 1.6; }
.dd-fee-tip { margin: 2px 0 12px; font-size: 12px; color: #98a2b3; line-height: 1.6; }
.dd-notice { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 12px 14px; }
.dd-notice p { margin: 4px 0; font-size: 12px; color: #667085; line-height: 1.7; }

@media (max-width: 1280px) {
    .dd-chart-grid, .dd-chart-grid-reconcile { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .dd-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 10px 4px; }
    .dd-report-hero { margin: 10px 10px 0; padding: 16px; flex-direction: column; align-items: flex-start; }
    .dd-report-hero-tags { justify-content: flex-start; }
    .dd-tab-nav { margin: 0 10px; }
    .dd-tab-panel { padding: 10px; }
    .dd-chart { height: 260px; }
    .dd-date-input { width: 124px; }
    .dd-wallet-strip { gap: 16px; }
}

/* 数据看板 */
.dd-dashboard { padding-bottom: 22px; }
.dd-dashboard-toolbar { margin: 14px 16px 0; }
.dd-dashboard-toolbar .dd-report-filter { box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.dd-kpi-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dd-todo-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 9px 16px 14px; }
.dd-todo-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border: 1px solid var(--dd-line); border-radius: 10px; background: #fff; color: #667085; font-size: 12.5px; cursor: pointer; text-decoration: none; transition: all .15s; }
.dd-todo-item:hover { border-color: #bcd7ff; background: #f5f9ff; color: var(--dd-primary); text-decoration: none; }
.dd-todo-item b { font-size: 18px; line-height: 1; color: #475467; font-variant-numeric: tabular-nums; }
.dd-todo-item.is-active { border-color: #fedf89; background: #fffaeb; color: #b54708; }
.dd-todo-item.is-active b { color: #b54708; }
.dd-chart-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dd-rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dd-rank-grid .dd-panel { min-width: 0; }
.dd-rank-table { margin: 0; }
.dd-rank-table thead th { background: #f8fafc; color: #667085; font-size: 12px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid #eef2f7; }
.dd-rank-table tbody td { color: #344054; font-size: 12.5px; padding: 10px; border-bottom: 1px solid #f1f4f9; white-space: nowrap; }
.dd-rank-table tbody tr:hover { background: #fbfdff; }
.dd-rank-table tbody tr:last-child td { border-bottom: 0; }
.dd-rank-table small { color: #98a2b3; font-size: 11px; }
.dd-rank-no { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #f2f4f7; color: #667085; font-size: 11px; font-weight: 600; }
.dd-rank-no.is-top { background: #fffaeb; color: #b54708; }
.dd-rank-amount { color: #101828 !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.dd-dash-notes .dd-notice { margin: 14px 18px 16px; }
.dd-dash-notes .dd-notice p { display: flex; align-items: flex-start; gap: 2px; }
.dd-dash-notes .dd-notice .dd-dot { flex: none; margin: 7px 7px 0 0; }
@media (max-width: 1500px) {
    .dd-kpi-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
    .dd-todo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dd-rank-grid, .dd-chart-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .dd-kpi-grid-6, .dd-todo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 列表页表格统一铺满内容区：列宽比例与表头/表体对齐由 admin-table.js 处理 */
.layui-table-view { width: 100% !important; }
.layui-table-view > .layui-table-box { width: 100% !important; overflow: hidden; }

/* 仅对“当前能完整放下”的表格启用铺满，列太多时保留 Layui 原生横向滚动 */
.dd-table-filled > .layui-table-box > .layui-table-body { overflow-x: hidden !important; }
.dd-table-filled > .layui-table-box .layui-table-cell { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.dd-table-filled > .layui-table-box > .layui-table-header > table > thead > tr > th,
.dd-table-filled > .layui-table-box > .layui-table-body > table > tbody > tr > td { overflow: hidden; }
.dd-table-filled .layui-table-fixed { display: none !important; }
