:root {
  --bg: #f4f6f9; --card: #fff; --primary: #2f6bff; --primary-dark: #1e4fd6;
  --text: #1a2233; --muted: #7a8699; --line: #e6eaf2;
  --green: #0aa870; --red: #e5484d; --orange: #f59a23; --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 80px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

.topbar { position: relative; background: linear-gradient(135deg, var(--primary), #5a8bff); color: #fff; padding: 14px 16px 18px 68px; border-radius: 0 0 16px 16px; min-height: 80px; }
.topbar h1 { font-size: 20px; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 4px; }
/* 顶栏左上角：公司Logo（上移贴顶，白色圆角卡片完整展示） */
.topbar::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 10px;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background-color: #fff;
  background-image: url('/logo.jpg?v=2');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 1px 4px rgba(0,0,0,.28);
}
/* Logo正下方：文件编号 SL-CX02（水平中心与logo重合，小字号不与文字交叉） */
.topbar::after {
  content: 'SL-CX02';
  position: absolute;
  left: 33px;
  top: 52px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .5px;
  line-height: 1;
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.4);
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
}
.page { padding: 12px 14px; }

.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(20,40,80,.06); }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 14px; }
.row .k { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef2ff; color: var(--primary); }
.tag.gray { background: #f0f2f6; color: var(--muted); }
.tag.green { background: #e6f7f0; color: var(--green); }
.tag.red { background: #fdebec; color: var(--red); }
.tag.orange { background: #fef4e6; color: var(--orange); }

.btn { display: block; width: 100%; border: none; border-radius: 10px; padding: 12px; font-size: 15px; background: var(--primary); color: #fff; margin-top: 10px; cursor: pointer; }
.btn:active { background: var(--primary-dark); }
.btn.green { background: var(--green); } .btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.small { width: auto; display: inline-block; padding: 6px 14px; font-size: 13px; margin: 0; }
.btn:disabled { opacity: .5; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px;
  font-size: 15px; background: #fbfcfe; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }

.fab {
  position: fixed; width: 52px; height: 52px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 30px; line-height: 1; border: none; box-shadow: 0 4px 12px rgba(47,107,255,.4);
  cursor: pointer; z-index: 50;
  right: max(16px, calc(50% - 280px + 16px)); bottom: 90px;
}
@media (max-width: 560px) { .fab { right: 16px; } }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px;
  background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 40; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; text-align: center; padding: 9px 0 7px; color: var(--muted); text-decoration: none; font-size: 11px; }
.tabbar a .ic { font-size: 20px; display: block; }
.tabbar a.on { color: var(--primary); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 14px; }
.warnbar { background: #fff8e0; color: #8a6d1a; font-size: 13px; padding: 9px 14px; border-radius: 10px; margin-bottom: 12px; }

.login-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.login-card { background: #fff; border-radius: 12px; padding: 16px 12px; text-align: center; border: 2px solid transparent; cursor: pointer; box-shadow: 0 1px 4px rgba(20,40,80,.06); }
.login-card:active { border-color: var(--primary); }
.login-card .av { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 8px; background: #e8eeff; color: var(--primary); font-size: 18px; font-weight: 600; line-height: 44px; }
.login-card .nm { font-size: 15px; font-weight: 600; }
.login-card .rl { font-size: 11px; color: var(--muted); margin-top: 3px; }

.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.statbox { background: #fff; border-radius: 12px; padding: 12px 8px; text-align: center; box-shadow: 0 1px 4px rgba(20,40,80,.06); }
.statbox .v { font-size: 20px; font-weight: 700; color: var(--primary); }
.statbox .k { font-size: 11px; color: var(--muted); margin-top: 3px; }

table.stats { width: 100%; border-collapse: collapse; font-size: 13px; }
table.stats th, table.stats td { padding: 8px 4px; text-align: center; border-bottom: 1px solid var(--line); }
table.stats th { color: var(--muted); font-weight: 500; font-size: 12px; }

#toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: rgba(20,28,45,.88); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; display: none; z-index: 99; max-width: 80%; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.statusline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.backlink { display: inline-block; color: var(--primary); text-decoration: none; font-size: 14px; margin-bottom: 10px; }

/* 启动页 */
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(180deg, #eef3ff 0%, #fff 100%); }
.splash-logo { width: 130px; height: 130px; border-radius: 24px; overflow: hidden; box-shadow: 0 8px 30px rgba(47,107,255,.25); }
.splash-logo img { width: 100%; height: 100%; object-fit: cover; }
.splash-title { font-size: 22px; font-weight: 700; margin-top: 20px; letter-spacing: 2px; color: var(--text); }
.splash-sub { font-size: 14px; color: var(--muted); margin-top: 6px; letter-spacing: 6px; }
.splash-enter { margin-top: 36px; padding: 12px 64px; font-size: 16px; letter-spacing: 8px; box-shadow: 0 6px 18px rgba(47,107,255,.3); }

/* 顶部标语 + 冠军滚动条（每页最上面）——黄红渐变背景，50% 透明度 */
.sloganbar { background: linear-gradient(90deg, rgba(255,214,0,.5), rgba(255,64,0,.5)); color: #7a2500; padding: 10px 14px 12px; }
.slogan { font-size: 18px; font-weight: 800; letter-spacing: 3px; text-align: center; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.champbar { margin-top: 8px; background: rgba(255,255,255,.55); color: #7a2500; border-radius: 8px; overflow: hidden; height: 26px; line-height: 26px; }
.marquee { display: inline-block; white-space: nowrap; font-size: 13px; padding-left: 100%; animation: marquee 16s linear infinite; font-weight: 600; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* 扫码浮层 */
.scanov { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.scanbox { background: #fff; border-radius: 14px; padding: 14px; width: 100%; max-width: 420px; }
.scanhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; }
.scanhead button { border: none; background: #f0f2f7; border-radius: 8px; padding: 6px 12px; }
#scanVideo { width: 100%; border-radius: 10px; background: #000; min-height: 220px; object-fit: cover; }
.scanhint { font-size: 12px; color: var(--muted); margin: 8px 0; text-align: center; }
.manualrow { display: flex; gap: 8px; margin-top: 4px; }

/* 通讯录勾选 */
.pickrow { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.pickrow:last-of-type { border-bottom: none; }
.pickrow input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
