/* ==================== rocket电竞报单系统 H5 · 淡粉可爱主题 ==================== */
:root {
  --primary: #ff7eb3;        /* 主色：淡粉 */
  --primary-dark: #ff5c9d;   /* 强调粉：渐变 / 深底 */
  --primary-light: #fff1f6;  /* 浅粉底 */
  --warning: #ff9f43;
  --success: #22b573;
  --danger: #f5483b;
  --text: #4a3b42;           /* 暖调深棕，柔和 */
  --sub: #9a8b92;
  --border: #f7e6ee;
  --bg: #fdf7fa;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  line-height: 1.6;
}
input, select, textarea {
  font-family: inherit; font-size: 15px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; background: #fff; outline: none; width: 100%;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9099' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.req { color: var(--danger); margin-left: 2px; }

/* ---------- 布局 ---------- */
.page { padding: 12px 12px 90px; max-width: 640px; margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, #ff7eb3, #ffa3c9); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.role-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: rgba(255,255,255,.22);
}
.link-btn {
  background: none; border: none; color: #fff; font-size: 13px; padding: 0; opacity: .9;
}
.card {
  background: #fff; border-radius: 18px; padding: 16px; margin-bottom: 12px;
  border: 1px solid #ffeaf2;
  box-shadow: 0 2px 10px rgba(255,126,179,.10);
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; margin-bottom: 12px;
}
.card-title .sub { font-size: 12px; color: var(--sub); font-weight: 400; }
.card-foot { font-size: 12px; color: var(--sub); text-align: center; padding-top: 10px; border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.mt { margin-top: 10px; }
.flex { flex: 1; min-width: 0; }
.col { flex: 1; min-width: 0; }
.hint { font-size: 12px; color: var(--sub); margin: 10px 0 0; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 999px; padding: 12px 16px; font-size: 15px;
  background: #fdf1f5; color: var(--text); cursor: pointer;
}
.btn:active { opacity: .8; }
.btn-primary { background: linear-gradient(135deg, #ff7eb3, #ff9ec6); color: #fff; font-weight: 600; }
.btn-outline { background: #fff; color: var(--primary-dark); border: 1px solid var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn.block { display: block; width: 100%; }
.btn.sm { padding: 0 14px; height: 42px; font-size: 13px; white-space: nowrap; }
.btn[disabled] { opacity: .5; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.field-tip { color: var(--sub); font-size: 12px; margin-top: 4px; }
.preview-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: var(--primary-light); border-radius: 8px; margin-bottom: 14px;
  font-size: 13px; color: var(--sub);
}
.money { color: var(--primary); font-size: 18px; font-weight: 600; }

/* ---------- 登录 ---------- */
.login-hero { text-align: center; padding: 36px 0 20px; }
.login-logo {
  width: 72px; height: 72px; margin: 0 auto 12px;
  border-radius: 24px; background: #fff; border: 2px solid #ffd9e8;
  box-shadow: 0 4px 14px rgba(255,126,179,.18);
  display: flex; align-items: center; justify-content: center;
}
.login-hero h1 { font-size: 20px; margin: 0 0 4px; }
.login-hero p { color: var(--sub); font-size: 13px; margin: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  flex: 1; background: none; border: none; padding: 10px 0; font-size: 15px;
  color: var(--sub); border-bottom: 2px solid transparent;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- 启动 ---------- */
.boot { text-align: center; padding: 80px 20px; color: var(--sub); }
.boot-logo {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 22px;
  background: #fff; border: 2px solid #ffd9e8;
  box-shadow: 0 4px 14px rgba(255,126,179,.18);
  display: flex; align-items: center; justify-content: center;
}
.boot .btn { margin-top: 20px; }

/* ---------- 用户卡 / 入口 ---------- */
.user-card {
  background: linear-gradient(135deg, #ff8fbb, #ffb3d1);
  border-radius: 18px; padding: 16px; color: #fff; display: flex; align-items: center; margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(255,126,179,.22);
}
.avatar {
  width: 48px; height: 48px; line-height: 48px; text-align: center; border-radius: 50%;
  background: #fff; color: var(--primary-dark); font-size: 20px; font-weight: 600; margin-right: 12px;
  border: 2px solid #fff;
}
.user-name { font-size: 17px; font-weight: 600; }
.user-sub { font-size: 12px; opacity: .9; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.entry {
  background: #fff; border-radius: 18px; padding: 16px 12px; text-align: center;
  border: 1px solid #ffeaf2;
  box-shadow: 0 2px 10px rgba(255,126,179,.10); cursor: pointer;
}
.entry-icon { display: flex; align-items: center; justify-content: center; min-height: 42px; }
.entry-name { font-weight: 600; margin-top: 4px; }
.entry-desc { font-size: 12px; color: var(--sub); }
.tips { margin: 0; padding-left: 18px; font-size: 13px; color: #9a8b92; }

/* ---------- chips / 统计 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  padding: 6px 14px; border-radius: 999px; background: #fff; color: #9a8b92;
  font-size: 13px; border: 1px solid #f7dce7; cursor: pointer;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* 客服业绩汇总只有「单数 / 业绩金额」两项，按两列铺满更好看 */
#csPerfStats { grid-template-columns: repeat(2, 1fr); }
.stat-item { text-align: center; padding: 6px 0; }
.stat-value { font-size: 18px; font-weight: 600; }
.stat-label { font-size: 12px; color: var(--sub); }
.t-primary { color: var(--primary); }
.t-success { color: var(--success); }
.t-warning { color: var(--warning); }
.t-danger { color: var(--danger); }
.t-text { color: var(--text); }

/* ---------- 列表 ---------- */
.list-title { font-size: 14px; font-weight: 600; margin: 4px 0 8px; padding: 0 4px; }
.order-card {
  background: #fff; border-radius: 16px; padding: 14px; margin-bottom: 10px;
  border: 1px solid #ffeaf2;
  box-shadow: 0 2px 8px rgba(255,126,179,.08);
}
.oc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.oc-customer { font-size: 15px; font-weight: 600; }
.oc-line { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; color: #6b5a63; }
.oc-line .k { color: var(--sub); }
.oc-remark {
  margin-top: 8px; padding: 8px 10px; background: #fff7fa; border-radius: 10px;
  font-size: 12px; color: #9a8b92;
}
.oc-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.oc-actions .btn { flex: 1; padding: 8px 0; font-size: 13px; }
.tag { font-size: 12px; padding: 2px 10px; border-radius: 4px; }
.tag-pending { background: rgba(255,159,67,.12); color: var(--warning); }
.tag-settled { background: rgba(34,181,115,.12); color: var(--success); }
.tag-off { background: #fdf1f5; color: var(--sub); }
.tag-admin { background: var(--primary-light); color: var(--primary); }
.empty { text-align: center; padding: 48px 0; color: var(--sub); font-size: 13px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 460px; }
.table th { color: var(--sub); font-weight: 400; text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 6px; text-align: right; border-bottom: 1px solid var(--border); }
.table th:first-child, .table td:first-child { text-align: left; }
.table tr.total td { font-weight: 600; background: #fff7fa; }

/* ---------- 账号管理 ---------- */
.user-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-item:last-child { border-bottom: none; }
.ui-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ui-meta { font-size: 12px; color: var(--sub); }
.ui-actions { display: flex; gap: 6px; }
.ui-actions .btn { padding: 6px 12px; font-size: 12px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item {
  flex: 1; text-align: center; padding: 8px 0 6px; font-size: 11px; color: var(--sub);
  background: none; border: none; cursor: pointer;
}
.tabbar-item.active { color: var(--primary); }
.tabbar-item .ti { display: flex; align-items: center; justify-content: center; height: 26px; line-height: 1; }
.tabbar-item .ti svg { display: block; }
.tabbar-item.active { font-weight: 600; }

/* ---------- 弹窗 / 吐司 ---------- */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.dialog {
  position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%);
  background: #fff; border-radius: 12px; padding: 18px; z-index: 41;
  max-height: 82vh; overflow-y: auto; max-width: 480px; margin: 0 auto;
}
.dialog-title { text-align: center; font-weight: 600; margin-bottom: 14px; }
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; z-index: 60; max-width: 80%; text-align: center;
}

/* ---------- 个人资料 ---------- */
#homeUserCard { cursor: pointer; }
.user-card .edit-hint {
  margin-left: auto; font-size: 12px; opacity: .9; white-space: nowrap; padding-left: 8px;
}
.profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--sub);
}
.profile-row b { color: var(--text); font-weight: 500; }
.profile-row:last-of-type { margin-bottom: 16px; }

/* ---------- 管理员中心 / 服务项目设置 ---------- */
.back-row { padding: 0 2px; margin: 0 0 12px; }
.link-btn.dark { color: var(--primary); font-size: 13px; }
.mgr-grid { display: flex; flex-direction: column; }
.mgr-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 2px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.mgr-item:last-child { border-bottom: none; }
.mgr-icon {
  width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--primary-light); border: 1px solid #ffe0ec;
}
.mgr-text { flex: 1; min-width: 0; }
.mgr-name { font-weight: 600; }
.mgr-desc { font-size: 12px; color: var(--sub); }
.mgr-arrow { color: var(--sub); font-size: 20px; }
#sysStats { grid-template-columns: repeat(4, 1fr); }

.svc-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.svc-item:last-child { border-bottom: none; }
.svc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.svc-name { font-weight: 600; }
.svc-meta { font-size: 12px; color: var(--sub); white-space: nowrap; }
.svc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.svc-actions .btn { height: 34px; padding: 0 10px; font-size: 12px; }
.svc-item.editing input[type="text"] { margin-bottom: 8px; }
.check-row {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: 12px; color: var(--sub);
}
.check-row input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; flex-shrink: 0;
  accent-color: var(--primary);
}

/* hidden 属性必须优先于作者样式里的 display，否则 .upload-preview / .row 等会显形 */
[hidden] { display: none !important; }

/* ---------- 头像上传 ---------- */
.avatar { overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar-lg {
  width: 72px; height: 72px; line-height: 72px; font-size: 28px;
  background: var(--primary-light); color: var(--primary-dark); margin-right: 0;
}
.avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar-edit-info { flex: 1; min-width: 0; }
.avatar-edit-name { font-weight: 600; margin-bottom: 2px; }
.btn-ghost { background: transparent; color: var(--sub); border: 1px solid var(--border); }

/* ---------- 品类设置表单 ---------- */
.form-mini { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.svc-item.editing .row.gap .col { min-width: 0; }
.svc-item.editing .row.gap.mt { margin-top: 8px; }
.svc-item.editing .check-row { margin: 10px 0 6px; }

/* ---------- 报单：附加项目多行 ---------- */
.addon-row { padding: 10px 0 8px; border-bottom: 1px dashed var(--border); }
.addon-row:last-child { border-bottom: none; }
.addon-row .row.gap { align-items: center; }
.addon-row select { min-width: 0; }
.addon-row .btn.sm {
  width: 34px; height: 34px; padding: 0; flex-shrink: 0;
  font-size: 16px; line-height: 1;
}
.addon-row .addon-meta { margin-top: 4px; font-size: 12px; color: var(--sub); }
/* 附加项目的数量输入 + 本项小计 */
.addon-qty-row { margin-top: 6px; align-items: flex-end; }
.addon-qty-row .addon-qty { width: 100%; }
.addon-subtotal { flex: 0 0 96px; }
.addon-subtotal-val {
  font-size: 15px; font-weight: 600; color: var(--primary);
  line-height: 34px; padding: 0 2px;
}

/* ---------- 分组 ---------- */
.tag-group { background: rgba(255,126,179,.14); color: var(--primary-dark); }
.check-wrap { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0 2px; }
.check-wrap .check-row { margin: 0; }
.user-item .user-group-sel { font-size: 13px; }

/* 名字下方的分组标签行 */
.user-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.user-tags .tag { margin-left: 0; }
/* 「我的标签」板块 */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list .tag-lg { font-size: 14px; padding: 6px 12px; border-radius: 6px; }
.tag-list .empty { width: 100%; }
/* 账号管理里可删除的标签 chip */
.grp-tags { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.grp-tags-label { font-size: 12px; color: var(--sub); flex-shrink: 0; padding-top: 3px; }
.grp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding-right: 6px; }
.chip-x {
  cursor: pointer; font-size: 11px; font-weight: 400; opacity: .65;
  width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%;
  background: rgba(0,0,0,.06);
}

/* ---------- 报单：建议标签 / 小票上传 ---------- */
.rec {
  font-size: 11px; font-weight: 500; color: var(--primary); margin-left: 8px;
  background: var(--primary-light); padding: 2px 7px; border-radius: 10px;
}
.upload-box {
  border: 1.5px dashed #ffc2d9; border-radius: 14px; padding: 12px;
  background: #fff7fa; min-height: 52px;
}
.upload-box input[type="file"] { width: 100%; font-size: 13px; }
.upload-preview { display: flex; align-items: center; gap: 12px; }
.upload-preview img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); background: #fff;
}
.oc-receipt { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.receipt-btn { height: 34px !important; padding: 0 12px !important; font-size: 12px !important; }
.receipt-missing { font-size: 12px; color: #d97706; }

/* ---------- 图片查看 ---------- */
.image-viewer {
  position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%);
  background: #fff; border-radius: 12px; padding: 14px; z-index: 51;
  max-height: 84vh; overflow-y: auto; max-width: 520px; margin: 0 auto;
}
.image-viewer img { width: 100%; height: auto; display: block; border-radius: 8px; }

