/* 门店老板后台（/admin/）统一外观：浅色侧栏 + 图标、卡片 / 表格 / 弹窗 / 按钮反馈。
   只由 admin/index.html（和 iOS 内嵌版 admin-ios-v1/index.html）加载；运营后台也引 admin.css，所以新样式都放这里，不改 admin.css。 */
:root {
  --side-bg: #f7f8fa; --side-line: #e6e8ee; --side-ink: #3b4555; --side-sub: #8a94a6; --side-hover: #eceff4;
  --side-active: #e8eefc; --side-active-ink: #1f4fd8; --side-icon: #6b7584; --side-card: #fff;
  --line: #e6e9f0; --bg: #f5f7fa; --radius: 12px;
}
body { -webkit-font-smoothing: antialiased; }

/* ---------- 侧栏 ---------- */
.shell { grid-template-columns: 236px minmax(0, 1fr); }
.side { padding: 0; background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line); overflow: hidden; }
.side-top { flex: none; padding: 14px 12px 6px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; }
.side-brand img { width: 30px; height: 30px; flex: none; object-fit: contain; }
.side-brand-text { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.side-brand strong { font-size: 15px; letter-spacing: .3px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-brand span { font-size: 12px; opacity: 1; color: var(--side-sub); }
.side-icon-btn { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--side-icon); cursor: pointer; padding: 0; }
.side-icon-btn:hover { background: var(--side-hover); color: var(--ink); }
.side-icon-btn svg, .ni { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
#nav { gap: 1px; padding: 2px 12px 12px; scrollbar-width: thin; scrollbar-color: #d4d9e2 transparent; grid-template-columns: minmax(0, 1fr); }
#nav a { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--side-ink); font-size: 14px; font-weight: 500; text-decoration: none; transition: background .12s, color .12s; }
#nav .nav-group ~ a { padding: 0 10px; }
#nav a .ni { color: var(--side-icon); transition: color .12s; }
#nav a:hover { background: var(--side-hover); color: var(--ink); }
#nav a:hover .ni { color: var(--ink); }
#nav a.active { background: var(--side-active); color: var(--side-active-ink); font-weight: 600; }
#nav a.active .ni { color: var(--side-active-ink); }
#nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-active-ink); }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav .nav-group { margin: 12px 0 2px; padding: 4px 10px; border-radius: 6px; color: var(--side-sub); font-size: 12px; font-weight: 600; letter-spacing: .5px; }
#nav .nav-group:hover { color: var(--ink); background: none; }
#nav .nav-group::after { width: 5px; height: 5px; opacity: .7; }
#nav .nav-group.has-dot::before { width: 6px; height: 6px; box-shadow: none; }
/* 角标统一：红点 = 有新消息；PRO = 套餐没含（灰蓝描边，不抢眼） */
#nav a .nav-dot { order: 3; flex: none; width: 7px; min-width: 0; height: 7px; padding: 0; margin: 0; border-radius: 50%; box-shadow: none; }
#nav a .nav-badge { order: 4; float: none; flex: none; margin-left: auto; height: 18px; line-height: 16px; padding: 0 6px; border-radius: 5px; border: 1px solid #c9d3ea; background: #fff; color: #5c6f9c; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; }
#nav a .nav-badge.readonly, #nav a.active .nav-badge.readonly { background: #fff; color: #5c6f9c; }
#nav a.active .nav-badge { border-color: #b7c7f3; color: var(--side-active-ink); }
.side-foot { flex: none; display: block; margin: 0; padding: 10px 12px 12px; border-top: 1px solid var(--side-line); font-size: 13px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 7px 6px 7px 8px; border: 1px solid var(--side-line); border-radius: 10px; background: var(--side-card); }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--side-active); color: var(--side-active-ink); font-weight: 700; font-size: 13px; }
.side-user-text { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.side-user-text strong { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text span { font-size: 12px; color: var(--side-sub); }
.side-foot .link-btn { color: inherit; opacity: 1; }
.side-tip { position: fixed; z-index: 120; transform: translateY(-50%); padding: 5px 10px; border-radius: 6px; background: #1b2330; color: #fff; font-size: 12.5px; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
@media (min-width: 901px) {
  body.side-mini .shell { grid-template-columns: 64px minmax(0, 1fr); }
  body.side-mini .side-top { padding: 12px 10px 4px; }
  body.side-mini .side-brand { flex-direction: column; gap: 8px; padding: 2px 0 8px; }
  body.side-mini .side-brand-text, body.side-mini .side-user-text, body.side-mini .nav-text { display: none; }
  body.side-mini #side-collapse svg { transform: scaleX(-1); }
  body.side-mini .side-user { flex-direction: column; gap: 6px; padding: 6px 0; border-color: transparent; background: none; }
  body.side-mini #nav { padding: 2px 10px 10px; scrollbar-width: none; }
  body.side-mini #nav .nav-group { height: 1px; margin: 9px 6px; padding: 0; background: var(--side-line); font-size: 0; pointer-events: none; }
  body.side-mini #nav .nav-group::after, body.side-mini #nav .nav-group::before { display: none; }
  body.side-mini #nav a.nav-folded { display: flex; }
  body.side-mini #nav a { justify-content: center; padding: 0; height: 40px; }
  body.side-mini #nav a.active::before { left: -10px; }
  body.side-mini #nav a .nav-badge { display: none; }
  body.side-mini #nav a .nav-dot { position: absolute; top: 8px; right: 8px; }
  body.side-mini .side-foot { padding: 8px 10px 12px; }
}

/* ---------- 主区域 ---------- */
.main { padding: 24px 32px 64px; }
.page-head { min-height: 40px; margin-bottom: 18px; }
.page-head h2 { font-size: 21px; letter-spacing: .2px; }
.card { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .03); padding: 18px 20px; margin-bottom: 16px; }
.card-head { gap: 12px; }
.card-head h3 { font-size: 15.5px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .03); padding: 16px 18px; }
.stat .value { font-size: 26px; letter-spacing: -.2px; }
.stat.accent { background: linear-gradient(135deg, #2b62ea, #1a45c4); border-color: transparent; }
a.stat:hover { border-color: #c9d3e6; }
a.btn, a.btn:hover, a.btn:visited { text-decoration: none; }
a.btn { color: var(--ink); }
a.btn.primary { color: #fff; }
.btn { height: 34px; padding: 0 14px; border-radius: 8px; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.block { height: 44px; border-radius: 10px; }
.btn:hover:not(:disabled) { border-color: #c3cde0; background: #fafbfd; }
.btn.primary:hover:not(:disabled) { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn.danger { border-color: #f3c5c7; }
.btn.danger:hover:not(:disabled) { background: #fff5f5; border-color: var(--red); }
.btn:focus-visible, a:focus-visible, .nav-group:focus-visible, .link-btn:focus-visible { outline: 2px solid rgba(31, 79, 216, .45); outline-offset: 2px; }
input, select, textarea { border-radius: 8px; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #cfd7e6; }
/* 点了就有反馈：按钮转圈 + 顶部细进度条（admin.js api） */
.btn.is-busy, .link-btn.is-busy { cursor: progress; opacity: .78; }
.btn.is-busy::before { content: ""; width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: btn-spin .7s linear infinite; flex: none; }
.link-btn.is-busy::after { content: "…"; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.net-bar { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 200; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden; }
.net-bar.on { opacity: 1; }
.net-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--blue); border-radius: 2px; animation: net-run 1.1s ease-in-out infinite; }
@keyframes net-run { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .net-bar::after, .btn.is-busy::before { animation-duration: 2.5s; } }

/* 表格：表头浅底、行悬停 */
th { font-size: 12.5px; color: #6b7584; background: #f8f9fb; border-bottom-color: var(--line); padding: 9px 10px; }
thead tr th:first-child { border-top-left-radius: 8px; }
thead tr th:last-child { border-top-right-radius: 8px; }
td { border-bottom-color: #eef1f5; padding: 11px 10px; }
tbody tr:hover td { background: #fafbfd; }
tr.gift-row:hover td { background: #f8f8f0; }
.tag { padding: 1px 9px; line-height: 20px; border-radius: 6px; font-weight: 500; }
.tag.orange { background: #fff4ea; color: #b8560f; }
.tabs a { padding: 6px 14px; border-radius: 8px; box-shadow: none; border: 1px solid var(--line); }
.tabs a:hover:not(.active) { color: var(--ink); border-color: #c9d3e6; }
.tabs a.active { border-color: var(--blue); }

/* 弹窗：标题、底部按钮区分隔 */
.modal-mask { background: rgba(15, 23, 42, .42); animation: mask-in .14s ease-out; }
.modal { border-radius: 14px; padding: 22px 24px 18px; gap: 14px; box-shadow: 0 24px 64px rgba(15, 23, 42, .22); animation: modal-in .16s ease-out; }
.modal h3 { font-size: 17px; }
.modal-foot { position: sticky; bottom: -18px; margin: 4px -24px -18px; padding: 12px 24px 16px; background: #fff; border-top: 1px solid #eef1f5; }
@keyframes mask-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.99); } }
@media (prefers-reduced-motion: reduce) { .modal, .modal-mask { animation: none; } }

/* 提示：成功带勾，失败红底 */
.toast { top: 20px; padding: 10px 16px; border-radius: 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; max-width: min(560px, calc(100vw - 32px)); }
.toast:not(.error):not(.with-art)::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: #2fb36b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.toast.error { background: #d93f45; }

/* 空状态、加载、出错 */
.empty { padding: 32px 0 16px; }
.empty img { width: 180px; }
.empty > div:first-of-type { color: var(--ink); font-weight: 600; font-size: 15px; }
.loading { padding: 64px 0; color: var(--sub); }

/* 去掉大片橙：升级引导、邀请横幅、额度提示改成品牌蓝浅底 */
.upgrade-guide { border-color: #d6e0f8; background: linear-gradient(180deg, #f5f8ff, #fff); }
.upgrade-icon { background: var(--blue); }
.sub-compare tr.highlight td { background: var(--blue-soft); }
.quota-hint { background: #fff7ed; color: #9a4a10; border: 1px solid #fde3c8; }
.invite-banner { background: linear-gradient(90deg, #f2f6ff, #fff); }
.invite-banner:hover { border-color: #c9d3e6; }
#sms-banner { border: 1px solid #d3def9 !important; border-left: 3px solid var(--blue) !important; }

/* ---------- 概览：先回答今天卖了多少、赚了多少、有什么要处理 ---------- */
.ov-todo .todo-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.todo-item { align-items: center; padding: 10px 14px; border-radius: 10px; background: #f6f8fc; border: 1px solid #edf0f6; }
.todo-item:hover { box-shadow: none; border-color: #b9c8f2; background: #f2f6ff; }
.todo-item strong { font-size: 20px; min-width: 28px; }
.todo-item span { flex: 1; }
.todo-item::after { content: "›"; color: var(--sub); font-size: 18px; }
.todo-done { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--sub); }
.todo-done::before { content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none; background: #e6f6ee url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%231d8a50' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.rpt-card .stats.rpt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.rpt-card .stat .value { font-size: 28px; }
.rpt-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 4px; }
.rpt-mini > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 9px 12px; border-radius: 10px; background: #f7f8fb; min-width: 0; }
.rpt-mini span { color: var(--sub); font-size: 13px; white-space: nowrap; }
.rpt-mini b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-mini a { color: inherit; text-decoration: none; }
.rpt-mini a:hover { color: var(--blue); }
a.mini-link:hover { box-shadow: inset 0 0 0 1px #b9c8f2; }
.rpt-mini small { display: block; color: var(--sub); font-size: 12px; font-weight: 400; text-align: right; }
.rpt-detail > .card-head { margin-bottom: 4px; }
.ov-member .mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini-grid > * { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: #f7f8fb; min-width: 0; }
.mini-grid span { color: var(--sub); font-size: 12.5px; }
.mini-grid b { font-size: 20px; font-variant-numeric: tabular-nums; }
.mini-grid small { color: var(--sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-anchor { display: none !important; }
.ask-quick { border: 1px solid var(--line); box-shadow: none; margin-bottom: 16px; }

/* ---------- 手机浏览器（≤900）：顶部白条 + 菜单抽屉 ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 60; height: auto; max-height: 100vh; border-right: 0; border-bottom: 1px solid var(--side-line); background: #fff; padding: env(safe-area-inset-top) 0 0; overflow-y: auto; }
  .side-top { padding: 10px 14px; }
  .side-brand { padding: 0; }
  #side-collapse { display: none; }
  .nav-toggle { border-color: var(--side-line); background: #fff; color: var(--ink); height: 36px; font-size: 14px; }
  #nav { grid-template-columns: 1fr; padding: 0 12px 8px; }
  #nav .nav-group ~ a { padding: 0 10px; }
  #nav a { height: 44px; font-size: 15px; }
  .side.open .side-foot { margin-top: 0; }
  .side-tip { display: none; }
  .main { padding: 18px 14px 40px; }
  .rpt-card .stats.rpt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-card .stats.rpt-stats > .stat.accent { grid-column: 1 / -1; }
  .ov-member .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-foot { position: static; margin: 0; padding: 0; border: 0; }
}
.avatar:empty { display: none; }
/* 页面里的文字链接：品牌蓝、不带下划线，悬停才出 */
.main a:not([class]) { color: var(--blue); text-decoration: none; }
.main a:not([class]):hover { text-decoration: underline; }
/* 带数字的红点（在线咨询待回复数）：红底白字小胶囊，靠右 */
#nav a .nav-dot:not(:empty) { width: auto; min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto; border-radius: 9px; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
body.side-mini #nav a .nav-dot:not(:empty) { min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; top: 7px; right: 7px; }
