/* utools 后台公共样式（管理员端 / 推广员端共用） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f3f5f7; color: #333; font-size: 14px; }
a { color: #3a7afe; text-decoration: none; cursor: pointer; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #3a7afe, #6a5cff); }
.login-card { background: #fff; border-radius: 10px; padding: 36px 32px; width: 340px; box-shadow: 0 10px 40px rgba(0, 0, 0, .15); }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: #999; font-size: 12px; margin-bottom: 22px; }
.login-card input { width: 100%; padding: 11px 12px; margin-bottom: 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.login-card button { width: 100%; padding: 11px; background: #3a7afe; color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; }
.login-card button:disabled { opacity: .6; }
.login-card .tip { color: #e64545; font-size: 13px; min-height: 18px; margin-bottom: 8px; text-align: center; }

/* 后台布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 190px; background: #1f2430; flex-shrink: 0; }
.sidebar .brand { padding: 18px 16px; color: #fff; font-size: 16px; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar .nav a { display: block; padding: 12px 16px; color: #a8aebb; cursor: pointer; font-size: 14px; }
.sidebar .nav a.active, .sidebar .nav a:hover { background: #2a3140; color: #fff; }
.main { flex: 1; padding: 20px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.topbar h2 { font-size: 18px; }
.topbar .who { color: #888; font-size: 13px; }

.cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border-radius: 8px; padding: 16px 18px; flex: 1; min-width: 140px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.card .label { color: #888; font-size: 13px; }
.card .num { font-size: 24px; font-weight: 600; margin-top: 6px; color: #3a7afe; }

.panel { background: #fff; border-radius: 8px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; }
.tb-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; white-space: nowrap; }
table.tb th { background: #fafafa; color: #666; font-weight: 500; }
table.tb tr:hover td { background: #f8faff; }

.btn { display: inline-block; padding: 6px 14px; border: 1px solid #3a7afe; color: #3a7afe; background: #fff; border-radius: 5px; cursor: pointer; font-size: 13px; }
.btn.primary { background: #3a7afe; color: #fff; }
.btn.danger { border-color: #e64545; color: #e64545; }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn + .btn { margin-left: 6px; }

input.ipt, select.ipt { padding: 7px 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; background: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters .lbl { color: #888; font-size: 12px; }

.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row label { width: 90px; color: #666; flex-shrink: 0; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.green { background: #e8f7ee; color: #1a9e54; }
.tag.red { background: #fdeaea; color: #e64545; }
.tag.orange { background: #fdf3e5; color: #e68a19; }
.tag.gray { background: #eee; color: #888; }
.tag.blue { background: #e8f0fe; color: #2f6feb; }

.score-up { color: #1a9e54; }
.score-down { color: #e64545; }
.muted { color: #999; font-size: 12px; }

#chart, .chart-box { width: 100%; height: 320px; }

.u-toast { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .78); color: #fff; padding: 10px 22px; border-radius: 6px; opacity: 0; transition: opacity .2s; z-index: 9999; font-size: 14px; max-width: 84%; text-align: center; }
.u-toast.show { opacity: 1; }
.u-modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 9998; }
.u-modal { background: #fff; border-radius: 10px; padding: 20px 22px; width: 420px; max-width: 92%; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
.u-modal h3 { margin: 0 0 4px; font-size: 16px; }

.pager { margin-top: 12px; }
.pager button { padding: 4px 10px; margin-right: 4px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; }
.pager button.active { background: #3a7afe; color: #fff; border-color: #3a7afe; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager-info { color: #999; font-size: 12px; margin-left: 8px; }

@media (max-width: 760px) {
  .sidebar { width: 120px; }
  .main { padding: 12px; }
}
