/* 元洲之友 · 设计系统（Deepsee 风格 token，复刻自参考仓 app.css） */

:root {
  --bg: #FFE9DC;            /* 桃色底 */
  --card: #ffffff;
  --green: #127820;         /* 主色 */
  --teal: #008C95;
  --brown: #6C5F57;
  --red: #FF5340;
  --orange-a: #FF6F00;      /* 签到卡渐变 */
  --orange-b: #FFA25B;
  --text: #282828;
  --text-light: #9b8d85;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(108, 95, 87, .12);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size:1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* hidden 属性必须绝对生效：display:flex 等会盖过 UA 的 [hidden]{display:none} */
[hidden] { display: none !important; }

/* 手机优先；PC 端居中栏 560px */
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px 88px;
  position: relative;
}
@media (min-width: 640px) {
  #app { box-shadow: 0 0 32px rgba(108, 95, 87, .18); }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size:1.125rem; }
.card .sub { color: var(--text-light); font-size:0.8125rem; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.topbar .logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size:1.375rem;
}
.topbar .site { flex: 1; }
.topbar .site .name { font-weight: 700; font-size:1.125rem; }
.topbar .site .hello { color: var(--text-light); font-size:0.8125rem; }

/* ---------- 用户卡 ---------- */
.usercard {
  display: flex;
  align-items: center;
  gap: 14px;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size:1.5rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.usercard .info { flex: 1; min-width: 0; }
.usercard .name { font-size:1.1875rem; font-weight: 700; }
.usercard .meta { color: var(--text-light); font-size:0.8125rem; }
.scorechip {
  background: rgba(18, 120, 32, .1);
  color: var(--green);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  text-align: center;
  flex: none;
}
.scorechip .n { font-size:1.25rem; }
.scorechip .t { font-size:0.6875rem; opacity: .8; }

/* ---------- 签到卡（橙渐变） ---------- */
.signcard {
  background: linear-gradient(135deg, var(--orange-a), var(--orange-b));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}
.signcard .info { flex: 1; }
.signcard .t { font-size:1.0625rem; font-weight: 700; }
.signcard .d { font-size:0.8125rem; opacity: .9; }

/* ---------- 会员证大入口 ---------- */
.qr-entry {
  display: block;
  text-decoration: none;
  background: linear-gradient(135deg, var(--teal), #006b73);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.qr-entry .qr-ico {
  width: 52px; height: 52px;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  flex: none;
}
.qr-entry .t { font-size:1.1875rem; font-weight: 700; }
.qr-entry .d { font-size:0.8125rem; opacity: .85; }
.qr-entry .arrow { margin-left: auto; font-size:1.375rem; opacity: .7; }

/* ---------- 宫格入口 ---------- */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.grid-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}
.grid-item .ico { font-size:1.875rem; margin-bottom: 6px; }
.grid-item .t { font-weight: 700; }
.grid-item.disabled { opacity: .45; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  background: var(--card);
  box-shadow: 0 -2px 12px rgba(108, 95, 87, .12);
  display: flex;
  z-index: 50;
}
.tabbar a {
  flex: 1;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  text-align: center;
  text-decoration: none;
  color: var(--text-light);
  font-size:0.75rem;
}
.tabbar a .ico { display: block; font-size:1.375rem; margin-bottom: 2px; }
.tabbar a.active { color: var(--green); font-weight: 700; }
.tabbar a .dot {
  display: inline-block;
  min-width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  margin-left: 4px;
}

/* ---------- 表单 / 按钮 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size:0.875rem; margin-bottom: 6px; color: var(--brown); }
.field input {
  width: 100%;
  padding: 14px;
  border: 1.5px solid rgba(108, 95, 87, .25);
  border-radius: 12px;
  font-size:1.125rem;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  outline: none;
}
.field input:focus { border-color: var(--teal); }

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size:1.0625rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:active { opacity: .85; }
.btn.teal { background: var(--teal); }
.btn.ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn:disabled { opacity: .5; }

/* 生日 4 选 1 */
.bday-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.bday-opt {
  padding: 16px 8px;
  background: #fff;
  border: 1.5px solid rgba(108, 95, 87, .2);
  border-radius: 12px;
  font-size:1.0625rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
}
.bday-opt:active { border-color: var(--green); color: var(--green); }
.bday-opt.picked { background: rgba(18,120,32,.08); border-color: var(--green); color: var(--green); }
.bday-opt:disabled { opacity: .55; cursor: default; }

/* ---------- 字体档位控件 + 大字号适配 ---------- */
.fontctl { display: flex; gap: 8px; }
.fontctl button {
  flex: 1; padding: 12px 4px; border: 1.5px solid rgba(108,95,87,.2); border-radius: 10px;
  background: #fff; font-weight: 700; cursor: pointer; white-space: normal; overflow-wrap: break-word;
  font-size: 1rem; color: var(--text);
}
.fontctl button.on { background: var(--green); border-color: var(--green); color: #fff; }
.fontctl button .demo { display: block; font-weight: 400; opacity: .75; font-size: .8125rem; margin-top: 2px; }
.fontpreview { margin-top: 10px; color: var(--text-light); font-size: .9375rem; line-height: 1.6; }

/* 文字放大后：窄排布局改单列，避免挤爆；按钮允许换行 */
html[data-fl="5"] .bday-grid { grid-template-columns: 1fr; }
.btn, .bday-opt, button, a { overflow-wrap: break-word; }
.profrow .v { overflow-wrap: anywhere; text-align: right; }

/* 版本 / 更新行 */
.verrow { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid rgba(108,95,87,.1); }
.verrow .k { font-size: .9375rem; }
.verrow .v { color: var(--text-light); font-size: .8125rem; margin-right: 8px; }
.updatebanner {
  margin: 12px 0; padding: 14px 16px; border-radius: 12px;
  background: rgba(255,111,0,.12); border: 1px solid rgba(255,111,0,.35);
  display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap;
}
.updatebanner .t { font-weight: 700; }
.updatebanner .d { font-size: .8125rem; opacity: .8; }

/* ---------- 入口页 ---------- */
.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  max-width: 560px;
  margin: 0 auto;
}
.splash .biglogo {
  width: 96px; height: 96px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size:2.875rem;
  margin-bottom: 12px;
}
.splash .name { font-size:1.625rem; font-weight: 800; }
.splash .sub { color: var(--brown); margin-bottom: 28px; }
.splash .btn { width: 280px; margin-bottom: 12px; }

/* ---------- 提示 ---------- */
.msg { text-align: center; color: var(--red); font-size:0.875rem; min-height: 20px; margin: 8px 0; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  background: rgba(40, 40, 40, .88);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size:0.875rem;
  z-index: 99;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

.loading { text-align: center; color: var(--text-light); padding: 40px 0; }

/* ---------- 纪录列表 ---------- */
.rowitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(108, 95, 87, .1);
}
.rowitem:last-child { border-bottom: none; }
.rowitem .main { flex: 1; min-width: 0; }
.rowitem .t { font-weight: 600; }
.rowitem .d { color: var(--text-light); font-size:0.8125rem; }
.delta { font-weight: 700; }
.delta.plus { color: var(--green); }
.delta.minus { color: var(--red); }

/* ---------- 活动卡 ---------- */
.act-card { padding: 0; overflow: hidden; }
.act-body { padding: 18px 20px; }
.act-title { font-size:1.125rem; font-weight: 700; margin-bottom: 6px; }
.act-meta { color: var(--text-light); font-size:0.8125rem; margin-bottom: 10px; }
.act-content { font-size:0.875rem; color: var(--brown); }
.act-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255, 233, 220, .55);
}
.tag {
  display: inline-block;
  font-size:0.75rem;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(0, 140, 149, .12);
  color: var(--teal);
  font-weight: 600;
}
.tag.green { background: rgba(18, 120, 32, .12); color: var(--green); }
.tag.red { background: rgba(255, 83, 64, .12); color: var(--red); }
.tag.gray { background: rgba(108, 95, 87, .12); color: var(--brown); }
