/* JM 加盟后台 — 手机自适应样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f6f7; color: #222; font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* ===== 登录 ===== */
#login-page {
  background: linear-gradient(160deg, #2e7d32 0%, #4CAF50 55%, #66bb6a 100%);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
#login-page.active { display: flex; }
.login-box {
  width: 100%; max-width: 380px; background: #fff;
  border-radius: 14px; padding: 32px 26px; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 14px;
  background: linear-gradient(135deg, #4CAF50, #2e7d32); color: #fff;
  font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.login-box h1 { text-align: center; font-size: 19px; margin-bottom: 2px; }
.login-sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 22px; }
.form-group { margin-bottom: 14px; }
.form-group input, .form-group select {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid #d9d9d9; border-radius: 8px; background: #fff; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: #4CAF50; }
.login-msg { text-align: center; color: #e53e3e; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ===== 页面视图（首页/功能页） ===== */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ===== 首页 header（仿 V3） ===== */
.header {
  background: #4CAF50;
  color: white;
  padding: 22px 20px 18px;
  text-align: center;
  position: relative;
}
.header h1 { font-size: 22px; margin-bottom: 4px; }
.header .subtitle { font-size: 12px; opacity: 0.9; }
.header-user {
  position: absolute; top: 12px; right: 14px;
  font-size: 12px; display: flex; align-items: center; gap: 8px; opacity: .95;
}
.header-user a { color: #fff; text-decoration: none; }

/* ===== 按钮宫格（仿 V3 module-grid） ===== */
.container { padding: 20px 16px; max-width: 560px; margin: 0 auto; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.module-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.module-card:active { background: #f2f9f2; }
.module-icon { font-size: 34px; margin-bottom: 10px; }
.module-name { font-size: 15px; font-weight: 600; color: #333; }
.grid-hint { text-align: center; color: #bbb; font-size: 12px; margin-top: 24px; }

/* ===== 功能页顶栏（返回条） ===== */
.backbar {
  position: sticky; top: 0; z-index: 100;
  background: #4CAF50; color: #fff;
  display: flex; align-items: center;
  padding: 12px 10px; gap: 6px;
}
.back-btn {
  color: #fff; text-decoration: none; font-size: 20px;
  padding: 2px 10px 2px 4px;
}
.backbar-title { flex: 1; font-size: 16px; font-weight: 600; }
.page-hint { color: #999; font-size: 12px; margin-bottom: 12px; }

/* ===== 内容 ===== */
.empty { text-align: center; color: #aaa; padding: 40px 0; font-size: 14px; }

/* 卡片 */
.card {
  background: #fff; border-radius: 10px; padding: 12px 14px;
  margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-main { flex: 1; min-width: 0; }
.card-name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-name .badge { font-size: 11px; background: #e8f5e9; color: #2e7d32; padding: 1px 7px; border-radius: 8px; font-weight: 400; }
.card-name .off { background: #fee2e2; color: #dc2626; }
.card-sub { font-size: 12px; color: #999; margin-top: 3px; }
.card-price { font-size: 18px; font-weight: 700; color: #e53e3e; white-space: nowrap; }
.card-price small { font-size: 12px; font-weight: 400; color: #999; }
.card-ops { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.card-ops-row { display: flex; gap: 8px; }

/* 开关 */
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #ccc; border-radius: 22px;
  transition: .2s; cursor: pointer;
}
.switch .slider:before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: #4CAF50; }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 9px 18px; font-size: 14px; border: none;
  border-radius: 8px; cursor: pointer; background: #f0f0f0; color: #333; text-align: center;
}
.btn:active { opacity: .8; }
.btn-primary { background: #4CAF50; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-outline { background: #fff; border: 1px solid #d9d9d9; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 12px; width: 100%; max-width: 400px;
  padding: 20px; box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
.modal-footer .btn { min-width: 84px; }
.form-label { display: block; font-size: 13px; color: #666; margin-bottom: 5px; }

/* ===== toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(0,0,0,.75); color: #fff; font-size: 14px;
  padding: 10px 18px; border-radius: 8px; z-index: 2000;
  opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; }
.toast.err { background: rgba(220,38,38,.9); }
