/* 爱最好 · 运营管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; background: #f0f2f5; color: #1f2329; font-size: 14px; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ---------- 登录 ---------- */
.login-wrap { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { width: 360px; background: #fff; border-radius: 12px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { font-size: 30px; font-weight: 700; text-align: center; background: linear-gradient(135deg,#667eea,#764ba2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { text-align: center; color: #8a9199; margin: 8px 0 28px; font-size: 13px; }
.login-tip { margin-top: 14px; color: #f5222d; font-size: 13px; text-align: center; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 208px; background: #1f2733; color: #c9d1d9; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; }
.brand { padding: 20px; font-size: 20px; font-weight: 700; color: #fff; }
.brand span { font-size: 12px; color: #7d8590; margin-left: 8px; font-weight: 400; }
.sidebar nav { flex: 1; padding: 8px 0; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 12px 20px; cursor: pointer; font-size: 14px; user-select: none; }
.sidebar nav a i { font-style: normal; width: 20px; text-align: center; }
.sidebar nav a:hover { background: #2a3441; color: #fff; }
.sidebar nav a.active { background: #667eea; color: #fff; border-radius: 0 22px 22px 0; margin-right: 12px; }
.sidebar nav a em { margin-left: auto; background: #f5222d; color: #fff; font-style: normal; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px; }
.side-foot { padding: 16px 20px; font-size: 12px; color: #5c6670; }
.main { flex: 1; margin-left: 208px; padding: 0 24px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px; }
.page-title { font-size: 18px; font-weight: 600; }
.admin-info { display: flex; align-items: center; gap: 12px; color: #555; }
.page { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.card { background: #fff; border-radius: 10px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card.warn { border-left: 4px solid #fa8c16; }
.card-num { font-size: 28px; font-weight: 700; color: #1f2329; }
.card-label { color: #8a9199; margin-top: 6px; font-size: 13px; }

/* ---------- 工具条/表格 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar input, .toolbar select, .form-item input, .form-item select, .cfg-input {
  padding: 8px 12px; border: 1px solid #d9dee4; border-radius: 6px; font-size: 14px; outline: none; background: #fff;
}
.toolbar input:focus, .form-item input:focus { border-color: #667eea; }
.tbl { width: 100%; background: #fff; border-radius: 10px; border-collapse: collapse; box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; }
.tbl th { background: #f7f8fa; text-align: left; padding: 12px 14px; color: #6b7280; font-weight: 600; font-size: 13px; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-top: 1px solid #f0f2f5; vertical-align: middle; }
.tbl tr:hover td { background: #fafbfc; }
.tbl .ellip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.muted { color: #9aa1a9; font-size: 12px; }

/* ---------- 徽标/按钮 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge.ok { background: #e8f7ee; color: #16a34a; }
.badge.off { background: #f2f3f5; color: #8a9199; }
.badge.wait { background: #fff7e6; color: #d48806; }
.badge.platform { background: #eef2ff; color: #4f46e5; }
.btn { border: 1px solid #d9dee4; background: #fff; color: #1f2329; padding: 8px 16px; border-radius: 6px; font-size: 14px; transition: all .15s; }
.btn:hover { border-color: #667eea; color: #667eea; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: #667eea; border-color: #667eea; color: #fff; }
.btn-primary:hover { background: #5a6fd6; color: #fff; }
.btn-block { width: 100%; margin-top: 6px; padding: 10px; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; margin-right: 6px; }
.btn-danger { border-color: #ffccc7; color: #f5222d; background: #fff; }
.btn-danger:hover { background: #fff1f0; border-color: #f5222d; }
.btn-ok { border-color: #b7eb8f; color: #389e0d; background: #fff; }
.btn-ok:hover { background: #f6ffed; border-color: #52c41a; }
.btn-text { border: none; background: none; color: #667eea; padding: 4px 8px; }

/* ---------- 分页/tabs ---------- */
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; padding: 16px 0; color: #6b7280; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid #e5e7eb; }
.tabs span { padding: 10px 18px; cursor: pointer; color: #6b7280; border-bottom: 2px solid transparent; }
.tabs span.on { color: #667eea; border-bottom-color: #667eea; font-weight: 600; }

/* ---------- 表单/弹窗 ---------- */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: #6b7280; font-size: 13px; }
.form-item input, .form-item select { width: 100%; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 420px; background: #fff; border-radius: 12px; padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-lg { width: 560px; }
.modal-xl { width: 880px; max-width: 94vw; }

/* 积分流水宽表: 固定列宽+说明列自动换行, 不产生横向滚动 */
.tbl-fixed { table-layout: fixed; width: 100%; }
.tbl-fixed .w-time { width: 170px; }
.tbl-fixed .w-type { width: 120px; }
.tbl-fixed .w-num { width: 100px; }
.tbl-fixed td.wrap-cell, .tbl-fixed th.wrap-cell { white-space: normal; word-break: break-all; line-height: 1.6; }

/* 商户编辑: 放大文本框与上传区 */
.textarea-lg { width: 100%; min-height: 96px; resize: vertical; }
.form-item textarea { width: 100%; padding: 8px 10px; border: 1px solid #d9dce3; border-radius: 6px; font-size: 13px; font-family: inherit; }
.upload-row { display: flex; gap: 8px; align-items: center; }
.upload-row input { flex: 1; }
.hidden-file { display: none; }
.cert-preview { margin-top: 8px; width: 200px; max-width: 100%; border-radius: 8px; border: 1px solid #e5e7eb; display: block; }

/* 商户详情: 收款二维码 */
.qrcode-box { text-align: left; }
.qrcode-img { width: 220px; height: 220px; border: 1px solid #e5e7eb; border-radius: 10px; display: block; }
.qrcode-tip { color: #6b7280; font-size: 12px; margin: 8px 0; }
/* 系统升级日志 */
.upgrade-log { background: #0f172a; border-radius: 10px; padding: 16px 18px; max-height: 320px; overflow-y: auto; margin-top: 8px; font-family: Consolas, 'Courier New', monospace; }
.up-log-item { display: flex; align-items: flex-start; padding: 4px 0; font-size: 13px; color: #cbd5e1; }
.up-log-ico { margin-right: 8px; flex-shrink: 0; }
.up-log-item.lv-ok .up-log-ico { color: #4ade80; }
.up-log-item.lv-warn .up-log-ico { color: #fbbf24; }
.up-log-item.lv-err .up-log-ico { color: #f87171; }
.up-log-item.lv-info .up-log-ico { color: #60a5fa; }
.upgrade-ok { margin-top: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; border-radius: 8px; padding: 12px 16px; font-size: 14px; font-weight: 600; }

/* 可滚动弹窗(内容超高时可内部滚动) */
.modal-scroll-box { display: flex; flex-direction: column; max-height: 88vh; }
.modal-title-fixed { flex-shrink: 0; }
.modal-scroll { flex: 1; overflow-y: auto; min-height: 0; padding-right: 4px; }
.modal-scroll-box .modal-btns { flex-shrink: 0; }
.nowrap { white-space: nowrap; }
select { padding: 8px 10px; border: 1px solid #d9dce3; border-radius: 6px; background: #fff; font-size: 13px; min-width: 120px; }
.modal h3 { margin-bottom: 18px; font-size: 16px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span2 { grid-column: span 2; }
.cfg-input { width: 200px; }

/* ---------- toast ---------- */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); padding: 10px 22px; border-radius: 8px; color: #fff; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: fade .2s; }
.toast.ok { background: #16a34a; }
.toast.err { background: #f5222d; }

/* ---------- v1.3: 仪表盘趋势 / 待办 / 详情 / 分类 ---------- */
.trend-wrap { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 6px 4px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-num { font-size: 12px; color: #4f46e5; margin-bottom: 4px; }
.trend-bar { width: 60%; max-width: 46px; background: linear-gradient(180deg, #667eea, #a5b4fc); border-radius: 6px 6px 2px 2px; transition: height .4s; }
.trend-day { font-size: 11px; color: #9aa1a9; margin-top: 6px; }
.trend-legend { margin-top: 10px; font-size: 12px; color: #6b7280; border-top: 1px solid #f0f1f5; padding-top: 10px; }
.todo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: #4f46e5; }
.check-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #4b5563; cursor: pointer; }
.w-sm { width: 110px !important; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; max-height: 62vh; overflow-y: auto; }
.detail-val { padding: 8px 12px; background: #f7f8fa; border-radius: 8px; font-size: 13px; color: #1f2937; line-height: 1.6; word-break: break-all; }
.detail-val.mono { font-family: ui-monospace, monospace; }
.cert-img { width: 220px; max-width: 100%; border-radius: 8px; border: 1px solid #e5e7eb; display: block; cursor: zoom-in; }
.cfg-hint { font-size: 12px; color: #9aa1a9; margin-top: 5px; }
.cfg-group-icon { margin-right: 8px; }
.num-in { color: #16a34a; font-weight: 600; }
.num-out { color: #f5222d; font-weight: 600; }

/* ---------- 空状态/面板 ---------- */
.empty { text-align: center; color: #9aa1a9; padding: 28px 0 !important; }
.empty-block { text-align: center; color: #9aa1a9; padding: 40px 0; background: #fff; border-radius: 10px; }
.panel { background: #fff; border-radius: 10px; padding: 18px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
.panel-title { font-weight: 600; margin-bottom: 10px; }
.panel.tip { color: #6b7280; font-size: 13px; line-height: 1.7; }
.panel.tip b { color: #4f46e5; }
.panel.tip code { background: #eef2ff; color: #4f46e5; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.card-num .small { font-size: 15px; font-weight: 400; }
.platform-strip { display: flex; align-items: center; gap: 12px; }

/* ---------- 商品导入 ---------- */
.import-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.imp-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 2px solid transparent; }
.imp-card.checked { border-color: #667eea; }
.imp-card.exists { opacity: .62; }
.imp-cover { position: relative; height: 130px; background: #f2f3f5; overflow: hidden; }
.imp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imp-check { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 3px 6px; }
.imp-check input { width: 15px; height: 15px; accent-color: #667eea; cursor: pointer; }
.imp-src { position: absolute; top: 8px; right: 8px; background: rgba(15,23,42,.65); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.imp-body { padding: 10px 12px 12px; }
.imp-title { font-size: 13px; line-height: 1.45; height: 38px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.imp-price { color: #f5222d; font-weight: 700; margin: 6px 0; }
.imp-price s { color: #9aa1a9; font-weight: 400; font-size: 12px; margin-left: 6px; }
.imp-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.imp-foot { border-top: 1px dashed #e5e7eb; padding-top: 8px; font-size: 12px; }

/* ---------- 平台接入 ---------- */
.plat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plat-card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; flex-direction: column; }
.plat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.plat-head b { font-size: 15px; }
.plat-switches { display: flex; gap: 18px; margin-bottom: 12px; }
.switch-row { display: flex; align-items: center; gap: 6px; color: #6b7280; font-size: 13px; cursor: pointer; user-select: none; }
.switch-row input { accent-color: #667eea; width: 15px; height: 15px; }
.plat-card .form-grid { grid-template-columns: 1fr 1fr; gap: 0 12px; }
.plat-card .form-item { margin-bottom: 10px; }
.plat-card .form-item label { font-size: 12px; }
.plat-card .form-item input { padding: 6px 10px; font-size: 13px; }
.form-item label em.req { color: #f5222d; font-style: normal; margin-left: 2px; }
.plat-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.plat-foot .muted { font-size: 12px; max-width: 220px; }

/* ---------- 系统设置分组 ---------- */
.cfg-group { margin-bottom: 22px; }
.cfg-group-title { font-size: 14px; font-weight: 600; margin: 0 0 10px 2px; color: #4f46e5; display: flex; align-items: center; gap: 10px; }
.cfg-group-title .btn-sm { margin: 0; }
.cfg-group-desc { font-size: 12px; color: #8a9199; margin: 0 0 10px 2px; line-height: 1.7; }
.cfg-group .cfg-input { width: 240px; }

/* ---------- 侧边栏底部链接 ---------- */
.side-foot { line-height: 1.7; }
.side-links a { color: #7cb7ff; text-decoration: none; font-size: 12px; }
.side-links a:hover { text-decoration: underline; }

/* v1.3.4 商户结算统计卡/推荐徽标/行内勾选 */
.stat-row { display:flex; gap:16px; margin:16px 0; flex-wrap:wrap; }
.stat-card { flex:1; min-width:200px; background:#fff; border-radius:12px; padding:18px 22px; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.stat-num { font-size:26px; font-weight:700; color:#1f2329; }
.stat-label { font-size:13px; color:#8a9199; margin-top:4px; }
.muted-badge { background:#f0f2f7; color:#8a9199; }
.check-inline { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#555; }
