/* ============================================================
   仿 APP 风格公共样式（彩民/业主/员工/管理员通用外壳）
   用法：页面 body 加 class="app-page"，内容包在 .app-shell 里
   逐页迁移：先 index，再 member.html、play.php，最后 owner/admin
   ============================================================ */

:root {
  --app-red: #EB3D41;
  --app-red-dark: #c92f33;
  --app-bg: #f5f5f5;
  --app-text: #333;
  --app-muted: #8a8f99;
  --app-line: #efefef;
  --app-tabbar-h: 58px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body.app-page {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px));
}

/* 桌面端居中，保持手机观感 */
.app-shell { max-width: 640px; margin: 0 auto; }

/* ---------------- 顶部红色标题栏 ---------------- */
.app-topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-height: 48px; padding: 0 14px;
  background: linear-gradient(135deg, #f04b4f 0%, var(--app-red) 55%, var(--app-red-dark) 100%);
  color: #fff;
}
.app-topbar h1 {
  font-size: 16px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-topbar .tb-action {
  flex-shrink: 0; font-size: 12px; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .2); border-radius: 14px; padding: 4px 12px;
  white-space: nowrap;
}
.app-topbar .tb-action:active { background: rgba(255, 255, 255, .35); }

/* ---------------- Banner 轮播 ---------------- */
.app-banner { position: relative; overflow: hidden; background: #222; }
.banner-track { display: flex; transition: transform .5s ease; will-change: transform; }
.banner-slide {
  flex: 0 0 100%; height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 22px; color: #fff;
}
.banner-slide h2 { font-size: 19px; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, .28); }
.banner-slide p { font-size: 12px; opacity: .92; margin-top: 5px; }
.slide-1 { background: linear-gradient(135deg, #EB3D41 0%, #ff6b35 60%, #f7b733 100%); }
.slide-2 { background: linear-gradient(135deg, #1a2a6c 0%, #b21f1f 55%, #fdbb2d 100%); }
.slide-3 { background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%); }
.banner-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 6px;
}
.banner-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, .42); border: 0; padding: 0;
  transition: background .3s, width .3s;
}
.banner-dot.on { background: #fff; width: 14px; border-radius: 4px; }

/* ---------------- 公告滚动 ---------------- */
.app-notice {
  display: flex; align-items: center; gap: 8px;
  margin: 10px; padding: 8px 12px;
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .05);
}
.app-notice .ntag {
  flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--app-red);
  display: flex; align-items: center; gap: 4px;
}
.app-notice .ntag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--app-red);
}
.notice-wrap { position: relative; flex: 1; height: 22px; overflow: hidden; }
.notice-item {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  font-size: 12px; color: #666;
  opacity: 0; transition: opacity .5s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notice-item.on { opacity: 1; }
.notice-item a { color: inherit; text-decoration: none; display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 卡片面板 ---------------- */
.app-panel {
  margin: 10px; background: #fff; border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .05); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--app-line);
}
.panel-head h2 {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--app-red);
}
.panel-head h2::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--app-red);
}
.panel-head .more { font-size: 12px; color: var(--app-muted); text-decoration: none; }

/* ---------------- 网格 ---------------- */
.app-grid { display: grid; gap: 6px; padding: 12px 8px; }
.app-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.app-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 2px; border-radius: 8px;
  text-decoration: none; color: #444; font-size: 12px; line-height: 1.2;
  transition: background .2s;
}
.grid-item:active { background: #f6f6f7; }

/* 圆形色块图标 */
.app-badge {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.app-badge.sm { font-size: 11px; letter-spacing: 0; }

/* 彩种配色 */
.bd-ssq  { background: linear-gradient(135deg, #e63946, #c1121f); }
.bd-dlt  { background: linear-gradient(135deg, #1976d2, #0d47a1); }
.bd-3d   { background: linear-gradient(135deg, #ff9800, #e65100); }
.bd-kl8  { background: linear-gradient(135deg, #43a047, #1b5e20); }
.bd-pl3  { background: linear-gradient(135deg, #5c6bc0, #283593); }
.bd-pl5  { background: linear-gradient(135deg, #00897b, #004d40); }
.bd-qxc  { background: linear-gradient(135deg, #7c3aed, #4a148c); }
.bd-qlc  { background: linear-gradient(135deg, #fbbf24, #d97706); }
.bd-jc   { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.bd-blue { background: linear-gradient(135deg, #2f80ed, #1c5bb8); }
.bd-gray { background: linear-gradient(135deg, #9aa3b2, #667085); }

/* ---------------- 免责声明 ---------------- */
.app-disclaimer {
  margin: 12px 10px 16px; padding: 12px;
  background: #fff8f8; border: 1px solid #f5c2c4; border-radius: 10px;
  text-align: center;
}
.app-disclaimer .t {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--app-red); margin-bottom: 6px;
}
.app-disclaimer p { font-size: 11px; line-height: 1.7; color: #c33; text-align: left; }

/* ---------------- 底部导航 ---------------- */
.app-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; background: #fff; border-top: 1px solid #e6e6e6;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 6px; text-decoration: none; color: #9aa0aa; font-size: 11px;
}
.app-tabbar a svg { width: 21px; height: 21px; }
.app-tabbar a.on { color: var(--app-red); font-weight: 600; }

/* ---------------- 彩民中心：会员信息首行 ---------------- */
.member-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 26px;
  background: linear-gradient(135deg, #f04b4f 0%, var(--app-red) 55%, var(--app-red-dark) 100%);
  color: #fff;
}
.member-hero .ava {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .22);
  font-size: 20px; font-weight: 700;
}
.member-hero .info { flex: 1; min-width: 0; }
.member-hero .nm {
  font-size: 17px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-hero .sb { font-size: 12px; opacity: .85; margin-top: 2px; }
.member-hero .out {
  flex-shrink: 0; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .2); color: #fff;
  font-size: 12px; padding: 5px 12px; border-radius: 14px;
}
.member-hero .out:active { background: rgba(255, 255, 255, .35); }

/* ---------------- 我的钱包 ---------------- */
.wallet-panel { margin-top: -16px; position: relative; z-index: 2; }
.wallet-top {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 14px 10px;
}
.wallet-top .lbl { font-size: 13px; color: #666; }
.wallet-top .amt { font-size: 24px; font-weight: 700; color: #222; letter-spacing: .5px; }
.wallet-top .amt small { font-size: 13px; font-weight: 400; color: #999; margin-left: 2px; }
.wallet-acts { display: flex; border-top: 1px solid var(--app-line); }
.wallet-acts a, .wallet-acts button {
  flex: 1; padding: 10px 0; border: 0; background: none; cursor: pointer;
  text-align: center; text-decoration: none; font-size: 13px; color: #444;
  border-right: 1px solid var(--app-line);
  font-family: inherit;
}
.wallet-acts > :last-child { border-right: 0; }
.wallet-acts .link { color: var(--app-red); }
.wallet-acts a:active, .wallet-acts button:active { background: #fafafa; }

/* ---------------- 投注记录：状态标签页 ---------------- */
.rec-tabs {
  display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--app-line);
  scrollbar-width: none;
}
.rec-tabs::-webkit-scrollbar { display: none; }
.rec-tab {
  flex: 0 0 auto; position: relative; cursor: pointer;
  padding: 9px 13px; border: 0; background: none;
  font-family: inherit; font-size: 13px; color: #666; white-space: nowrap;
}
.rec-tab em { font-style: normal; font-size: 11px; color: #b0b4bb; margin-left: 2px; }
.rec-tab.on { color: var(--app-red); font-weight: 700; }
.rec-tab.on em { color: var(--app-red); }
.rec-tab.on::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 20px; height: 3px; border-radius: 2px; background: var(--app-red);
}
.rec-sum {
  padding: 8px 12px; font-size: 12px; color: #888; background: #fafafa;
  border-bottom: 1px solid #f5f5f5;
}
.rec-sum b { color: #333; font-weight: 600; }
.rec-sum b.money { color: var(--app-red); }
.rec-item { padding: 11px 12px; border-bottom: 1px solid #f4f4f5; }
.rec-item:last-child { border-bottom: 0; }
.rec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rec-title { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-money { flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--app-red); }
.rec-sub { margin-top: 5px; font-size: 12px; color: var(--app-muted); }
.rec-acts { display: flex; gap: 8px; margin-top: 9px; }
.rec-acts button { flex: 1; }
.app-empty { padding: 26px 14px; text-align: center; font-size: 13px; color: #a8adb5; }

/* 状态徽标 */
.st-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: 11px; line-height: 17px; font-weight: 500;
  border-radius: 4px; border: 1px solid transparent;
  vertical-align: 1px;
}
.st-pending   { color: #a2620a; background: #fff5e0; border-color: #f0d9a8; }
.st-ticketed  { color: #1f5fae; background: #e8f0fd; border-color: #c3d8f5; }
.st-redeemed  { color: #1d7a3d; background: #e7f6ec; border-color: #bfe5cc; }
.st-paid      { color: #fff;    background: #1d7a3d; border-color: #1d7a3d; }
.st-unwon     { color: #6b7280; background: #f0f1f3; border-color: #d9dce1; }
.st-rejected  { color: #c81e28; background: #fdecec; border-color: #f3c2c5; }
.st-cancelled { color: #6b7280; background: #f0f1f3; border-color: #d9dce1; }
.st-chase     { color: #9a5b00; background: #fff4e0; border-color: #f0d9a8; }

/* ---------------- 按钮 ---------------- */
.app-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 18px; border: 1px solid transparent;
  font-family: inherit; font-size: 13px; cursor: pointer;
  background: #f2f3f5; color: #444;
  text-decoration: none;
}
.app-btn:active { opacity: .8; }
.app-btn.primary { background: var(--app-red); color: #fff; border-color: var(--app-red); }
.app-btn.block { display: flex; width: 100%; padding: 11px 14px; border-radius: 24px; font-size: 15px; }
.app-btn[disabled] { opacity: .55; cursor: default; }

/* ---------------- 表单 ---------------- */
.app-form { margin: 14px 10px; background: #fff; border-radius: 12px; padding: 16px 14px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.app-form label { display: block; font-size: 13px; color: #666; margin-bottom: 14px; }
.app-form input, .app-form select {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 12px; font-size: 15px; font-family: inherit;
  color: #222; background: #f7f7f8;
  border: 1px solid #e6e7ea; border-radius: 8px;
  outline: none;
}
.app-form input:focus { border-color: var(--app-red); background: #fff; }
.app-form .tip-inline { margin: 12px 0 0; text-align: center; font-size: 12px; color: #999; }
.app-form .tip-inline a { color: var(--app-red); text-decoration: none; }
.app-auth-wrap { padding-top: 22px; }
.app-auth-title { text-align: center; font-size: 17px; font-weight: 700; color: #333; margin: 6px 0 2px; }
.app-auth-sub { text-align: center; font-size: 12px; color: #999; margin-bottom: 4px; }

/* ---------------- 弹层 ---------------- */
.app-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, .55);
}
.app-box {
  width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 12px; padding: 14px;
}
.app-box h3 { font-size: 15px; margin-bottom: 8px; color: #222; }
.app-box img { display: block; width: 100%; border-radius: 8px; }
.app-pre {
  margin: 0; padding: 0; white-space: pre-wrap; word-break: break-all;
  font-size: 13px; line-height: 1.8; color: #333; font-family: inherit;
}
.app-box-acts { display: flex; gap: 10px; margin-top: 12px; }
.app-box-acts > * { flex: 1; }

/* 交易记录列表 */
.log-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid #f4f4f5; font-size: 13px;
}
.log-item:last-child { border-bottom: 0; }
.log-item .l { min-width: 0; }
.log-item .nm { color: #333; font-weight: 500; }
.log-item .tm { font-size: 11px; color: #a0a5ad; margin-top: 2px; }
.log-item .am { flex-shrink: 0; font-weight: 700; color: #1d7a3d; }
.log-item .am.minus { color: #c81e28; }

/* ---------------- 支付说明文字 ---------------- */
.pay-note { margin: 10px; padding: 12px; background: #fff8f8; border: 1px solid #f5c2c4; border-radius: 10px; }
.pay-note p { font-size: 12px; color: #c33; line-height: 1.7; }

.app-toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 9999; max-width: 78%;
  padding: 10px 18px; border-radius: 8px;
  background: rgba(0, 0, 0, .8); color: #fff; font-size: 13px;
}
.hidden { display: none !important; }

@media (max-width: 360px) {
  .app-badge { width: 38px; height: 38px; font-size: 11px; }
  .app-grid { gap: 4px; padding: 10px 6px; }
  .banner-slide h2 { font-size: 17px; }
}
