/* ============ 活动预定 · 通用样式（移动优先 / 微信风格） ============ */
:root {
  --primary: #fa5151;
  --success: #07c160;
  --warn: #fa9d3b;
  --info: #10aeff;
  --text: #1a1a1a;
  --text-2: #666;
  --text-3: #999;
  --line: #ebebeb;
  --bg: #f5f6f8;
  --card: #fff;
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 84px;
}
img { max-width: 100%; display: block; }
a { color: var(--info); }

/* 顶部 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }

.wrap { padding: 12px; max-width: 680px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 16px; margin: 0 0 8px; }
.card h3 { font-size: 14px; margin: 0 0 6px; color: var(--text-2); font-weight: 500; }

/* 活动卡片 */
.cover { width: 100%; height: 150px; border-radius: 10px; object-fit: cover; background: #eef0f3; }
.cover-ph {
  width: 100%; height: 120px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 20px; font-weight: 600; letter-spacing: 2px;
  background: linear-gradient(135deg, #fa5151, #ff8a5b);
}
.act { display: block; background: #fff; border-radius: var(--radius); padding: 12px; margin-bottom: 12px; cursor: pointer; }
.act:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.act-title { font-size: 16px; font-weight: 600; margin: 10px 0 6px; }
.meta { color: var(--text-2); font-size: 13px; margin: 2px 0; }
.price { color: var(--primary); font-weight: 700; font-size: 18px; }
.price small { font-size: 12px; font-weight: 400; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tag-gray { background: #f2f2f2; color: #999; }
.tag-red { background: #fdecec; color: #e64340; }
.tag-green { background: #e8f8ef; color: #07c160; }
.tag-blue { background: #e8f3ff; color: #10aeff; }
.tag-orange { background: #fff7e6; color: #fa9d3b; }

/* 提示条 */
.notice {
  background: #fff7e6; border: 1px solid #ffe1ac; color: #a4650a;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0;
}
.notice b { color: #8a5200; }
.notice-red { background: #fdecec; border-color: #f8c9c9; color: #c0392b; }
.notice-green { background: #e8f8ef; border-color: #bfe9d1; color: #0d7a44; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; font-size: 15px; font-family: inherit; color: var(--text);
  padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--success); }
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* 按钮 */
.btn {
  display: block; width: 100%; border: none; border-radius: 10px; padding: 13px;
  font-size: 16px; font-weight: 600; font-family: inherit; cursor: pointer;
  background: var(--success); color: #fff;
}
.btn:disabled { background: #ccc; }
.btn-primary { background: var(--primary); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid #ddd; }
.btn-sm { width: auto; padding: 7px 14px; font-size: 13px; font-weight: 500; border-radius: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-btn {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.footer-btn .inner { max-width: 680px; margin: 0 auto; }

/* 底部 Tab */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; border: none; background: none; font-family: inherit; font-size: 12px;
  color: var(--text-3); padding: 8px 0 9px; cursor: pointer;
}
.tabbar button.on { color: var(--success); font-weight: 600; }
.tabbar .ico { display: block; font-size: 18px; line-height: 1.2; }

/* 订单卡 */
.order { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.order-title { font-weight: 600; font-size: 15px; }
.order-line { font-size: 13px; color: var(--text-2); margin: 2px 0; }
.order-line b { color: var(--text); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; }
.code-box {
  text-align: center; background: #f7f8fa; border: 1px dashed #d5d8dd; border-radius: 10px;
  padding: 12px; margin: 10px 0;
}
.code-box .big { font-size: 26px; font-weight: 700; letter-spacing: 3px; color: var(--text); }
.code-box .cap { font-size: 12px; color: var(--text-3); }
.amount-big { font-size: 30px; font-weight: 700; color: var(--primary); text-align: center; margin: 6px 0; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }

/* 收款码 */
.paycode { width: 210px; margin: 8px auto 4px; border-radius: 10px; border: 1px solid var(--line); }
.paycode-missing {
  width: 100%; padding: 22px 12px; text-align: center; color: var(--text-3); font-size: 13px;
  border: 1px dashed #d5d8dd; border-radius: 10px; background: #fafbfc;
}

/* 空态 / 提示 */
.empty { text-align: center; color: var(--text-3); padding: 40px 16px; font-size: 14px; }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; z-index: 99; max-width: 76%; text-align: center; white-space: pre-wrap;
}
.hidden { display: none !important; }

/* 备份内容浮层：微信内置浏览器普遍不支持 a[download]，用文本通道兜底 */
.sheet-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; width: 100%; max-width: 680px; border-radius: 14px 14px 0 0;
  padding: 16px; max-height: 88vh; display: flex; flex-direction: column;
}
.sheet h3 { margin: 0 0 8px; font-size: 16px; }
.sheet .hint { font-size: 12px; color: var(--text-2); margin-bottom: 10px; line-height: 1.7; }
.sheet textarea {
  flex: 1; min-height: 34vh; width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--text-2);
  resize: none; background: #fafbfc;
  -webkit-user-select: text; user-select: text;
}
.sheet .sheet-btns { display: flex; gap: 10px; margin-top: 12px; }
.sheet .sheet-btns .btn { flex: 1; }

/* 表格（管理端） */
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.tb th { color: var(--text-2); font-weight: 500; background: #fafbfc; }
.table-scroll { overflow-x: auto; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: #fff; border-radius: 10px; padding: 12px; }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ============ 门户首页（功能宫格） ============ */
.hero {
  background: linear-gradient(135deg, #fa5151, #ff8a5b);
  color: #fff; border-radius: var(--radius);
  padding: 18px 16px; margin-bottom: 14px;
}
.hero-name { font-size: 20px; font-weight: 600; line-height: 1.3; }
.hero-sub { font-size: 13px; opacity: .9; margin-top: 5px; }
.hero-meta { font-size: 12px; opacity: .92; margin-top: 10px; }
.hero-meta b { font-weight: 600; }
.hero-meta .dot { opacity: .5; margin: 0 7px; }

.sec-title { font-size: 13px; color: var(--text-2); margin: 4px 2px 8px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile {
  position: relative; display: block; min-height: 104px;
  background: #fff; border-radius: var(--radius); padding: 14px 12px;
  color: var(--text); text-decoration: none; cursor: pointer;
}
.tile:active { background: #f7f8fa; }
.tile-ico { display: block; font-size: 24px; line-height: 1; margin-bottom: 9px; }
.tile-title { display: block; font-size: 15px; font-weight: 600; }
.tile-desc { display: block; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.tile-go {
  position: absolute; right: 10px; bottom: 8px;
  font-size: 18px; color: var(--text-3); line-height: 1;
}
.tile-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; color: var(--text-3); background: #f2f2f2;
  border-radius: 999px; padding: 1px 7px;
}
.tile-off { opacity: .6; }

.portal-foot { text-align: center; font-size: 12px; color: var(--text-3); padding: 14px 0 4px; }
