:root {
  --magenta: #e91e8c;
  --magenta-dark: #c2185b;
  --pink: #ff4fa3;
  --cyan: #2ec4d6;
  --teal: #26a69a;
  --teal-banner: #4db6ac;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #222;
  --muted: #8a8a8a;
  --border: #e5e5e5;
  --line: #ececec;
  --radius: 12px;
  --max: 750px;
  --nav-h: 56px;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", sans-serif;
  background: #ececec;
  color: var(--text);
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
  padding-bottom: calc(var(--nav-h) + 12px);
  box-shadow: 0 0 24px rgba(0,0,0,.06);
}

/* ===== Bottom nav (line-art) ===== */
.nav-bottom {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: var(--max);
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid #b5b5b5;
  display: flex; justify-content: space-around; align-items: stretch;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-bottom a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #3b3b3b; font-size: 11px; gap: 2px;
}
.nav-bottom a img.nav-icon,
.nav-bottom a .nav-svg {
  width: 24px; height: 24px; display: block;
  opacity: .75;
}
.nav-bottom a .nav-svg { color: #555; }
.nav-bottom a.active { color: var(--magenta); font-weight: 600; }
.nav-bottom a.active .nav-svg { color: var(--magenta); opacity: 1; }
.nav-bottom a.active img.nav-icon { opacity: 1; filter: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  color: #fff !important;
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 14px rgba(233,30,140,.25);
}
.btn.magenta {
  background: var(--magenta);
  box-shadow: 0 4px 12px rgba(233,30,140,.3);
}
.btn.secondary {
  background: #fff; color: var(--magenta) !important;
  border: 1px solid var(--magenta);
  box-shadow: none;
}
.btn.sm { padding: 6px 14px; font-size: 13px; width: auto; }

/* ===== Cards / common ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  margin: 10px 12px;
  padding: 14px;
  border: 1px solid var(--border);
}
.muted { color: var(--muted); font-size: 13px; }
.page-title { padding: 10px 16px 0; font-size: 18px; font-weight: 700; text-align: center; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: #fce4ec; color: var(--magenta); font-size: 12px; margin: 2px;
}
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; z-index: 100; display: none;
}

/* ===== HOME: bodygraph stage ===== */
.home-stage { position: relative; background: #fff; overflow: hidden; }
.home-transit {
  position: absolute; top: 8px; right: 10px; z-index: 5;
  text-align: right; font-size: 12px; line-height: 1.45;
}
.home-transit .t-title { color: #111; font-weight: 700; font-size: 13px; }
.home-transit .t-date { color: #555; }
.home-transit .t-lunar { color: #1e88e5; }
.home-transit .t-stem { color: var(--magenta); }

.bg-banner {
  position: absolute; top: 6px; left: 10px; z-index: 5;
  display: flex; align-items: baseline; gap: 6px;
}
.bg-banner .num {
  font-size: 34px; font-weight: 800; color: var(--magenta);
  letter-spacing: -1px; line-height: 1;
}
.bg-banner .lab {
  display: flex; flex-direction: column; font-size: 12px; color: #444; line-height: 1.3;
}
.bg-banner .lab b { font-size: 14px; color: #222; }

.bodygraph-wrap {
  position: relative; width: 100%;
  max-width: 420px; margin: 0 auto;
  padding-top: 36px;
}
.bodygraph-wrap .map-img {
  width: 100%; display: block; height: auto;
}
/* Gate number overlay (simplified demo positions as % of map) */
.gate-layer {
  position: absolute; left: 22%; top: 12%; width: 56%; height: 72%;
  pointer-events: none;
}
.gate-dot {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; font-size: 10px; line-height: 18px; text-align: center;
  color: #111; background: transparent; font-weight: 600;
}
.gate-dot.on { background: #111; color: #fff; }

.personality-col {
  position: absolute; right: 2%; top: 14%; width: 18%;
  display: flex; flex-direction: column; gap: 2px; z-index: 4;
}
.personality-col img {
  width: 100%; display: block; border-radius: 2px;
}
.hex-side {
  position: absolute; left: 3%; top: 42%; z-index: 4;
  text-align: center; width: 48px;
}
.hex-side .gua {
  width: 36px; height: 48px; margin: 0 auto 4px;
  background: repeating-linear-gradient(
    to bottom,
    #1e88e5 0 4px, transparent 4px 7px
  );
  border-radius: 2px;
}
.hex-side .name { font-size: 12px; color: #1e88e5; font-weight: 700; }
.hex-side .ch { font-size: 10px; color: #666; line-height: 1.2; }

.home-proof {
  text-align: center; padding: 10px 16px 4px;
  font-size: 15px; color: #333; font-weight: 600;
}
.home-proof em { font-style: normal; color: var(--magenta); }

.home-ctas { padding: 8px 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.home-ctas .btn-other {
  background: var(--magenta);
  border-radius: 999px; color: #fff; text-align: center;
  padding: 12px 16px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.home-intro { padding: 8px 20px 16px; }
.home-intro h3 {
  color: #1565c0; font-size: 16px; margin: 0 0 10px; font-weight: 700;
}
.home-intro ul { list-style: none; margin: 0; padding: 0; }
.home-intro li {
  color: var(--magenta); font-size: 14px; line-height: 1.9;
  padding-left: 14px; position: relative;
}
.home-intro li::before {
  content: ""; position: absolute; left: 0; top: 0.65em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--magenta);
}

/* Accordions */
.acc-list { border-top: 1px solid var(--line); }
.acc-item {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.acc-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; font-size: 14px; color: #333;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item .acc-ico {
  width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
}
.acc-item .acc-exp {
  margin-left: auto; color: #999; font-size: 12px;
  display: flex; align-items: center; gap: 2px;
}
.acc-item .acc-exp::after { content: "▾"; }
.acc-item[open] .acc-exp::after { content: "▴"; }
.acc-item .acc-body {
  padding: 0 16px 14px 48px; font-size: 13px; color: #666; line-height: 1.7;
}

.section-bar {
  background: #f0f0f0; padding: 8px 16px; font-size: 13px;
  font-weight: 700; color: #444; border-top: 1px solid var(--line);
}
.energy-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.energy-row img, .energy-row .leg {
  width: 28px; height: 28px; object-fit: contain; flex-shrink: 0;
}
.energy-row .hint { margin-left: auto; color: var(--magenta); font-size: 13px; }

.site-footer {
  background: #e8e8e8; color: #666; font-size: 11px;
  text-align: center; padding: 16px 12px 20px; line-height: 1.7;
}
.site-footer a { color: #1565c0; }

/* ===== MINE ===== */
.mine-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 16px 8px;
}
.mine-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: #e0e0e0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.mine-avatar svg { width: 40px; height: 40px; color: #9e9e9e; }
.mine-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mine-name { font-size: 16px; font-weight: 700; }
.mine-name .sub { font-weight: 400; color: #888; font-size: 14px; }
.mine-edit {
  margin-left: auto; color: #888; font-size: 13px;
  display: flex; align-items: center; gap: 4px;
}

.vip-banner {
  margin: 8px 14px;
  background: linear-gradient(90deg, #4db6ac, #26a69a);
  border-radius: 10px; padding: 14px 14px;
  display: flex; align-items: center; justify-content: space-between;
  color: #fff; font-size: 14px; font-weight: 600;
}
.vip-banner .go {
  background: linear-gradient(90deg, #ff6bb5, #e91e8c);
  color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px;
  font-weight: 700; white-space: nowrap;
}

.mine-block {
  margin: 12px 12px; background: #fff; border-radius: 10px;
  border: 1px solid var(--border); padding: 10px 8px 14px;
}
.mine-block .blk-title {
  font-size: 13px; color: #666; padding: 4px 8px 10px; font-weight: 600;
}
.mine-block .blk-title .hi { color: var(--magenta); margin-left: 6px; }
.mine-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 4px;
}
.mine-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; color: #444; text-align: center;
}
.mine-grid .ico {
  width: 28px; height: 28px; color: #666;
  display: flex; align-items: center; justify-content: center;
}
.mine-grid .ico svg { width: 24px; height: 24px; }
.mine-single {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; font-size: 14px; color: #333;
}
.mine-single .ico { width: 24px; height: 24px; color: #666; }
.mine-single .arrow { margin-left: auto; color: #ccc; }

/* ===== Courses ===== */
.course-banner {
  width: calc(100% - 24px); margin: 10px 12px; border-radius: 10px;
  overflow: hidden; display: block;
}
.course-banner img { width: 100%; display: block; }
.course-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.course-item img {
  width: 100px; height: 72px; object-fit: cover; border-radius: 8px; background: #eee; flex-shrink: 0;
}
.course-item .meta { flex: 1; min-width: 0; }
.course-item .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-item .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.course-item .price { color: var(--magenta); font-weight: 700; margin-top: 6px; font-size: 14px; }
.course-item .price s { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }

/* ===== Community / jiedushi ===== */
.community-tabs {
  display: flex; gap: 0; overflow-x: auto; padding: 0 8px;
  border-bottom: 1px solid var(--border); background: #fff;
}
.community-tabs a {
  flex: 0 0 auto; padding: 12px 14px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.community-tabs a.active { color: var(--magenta); border-bottom-color: var(--magenta); font-weight: 600; }
.feed-item {
  background: #fff; margin: 10px 12px; padding: 14px; border-radius: 10px;
  border: 1px solid var(--border);
}
.feed-item .author { font-weight: 600; font-size: 14px; }
.feed-item .time { font-size: 12px; color: var(--muted); }
.analyst-card {
  display: flex; gap: 12px; padding: 14px; background: #fff;
  border-radius: 12px; border: 1px solid var(--border); margin-bottom: 10px;
}
.analyst-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* forms / chat leftovers */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); font-size: 15px; background: #fafafa;
}
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 140px); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 16px; }
.bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px;
  font-size: 14px; line-height: 1.5; white-space: pre-wrap;
}
.bubble.user { background: var(--magenta); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bubble.assistant { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-input {
  display: flex; gap: 8px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--border);
}
.chat-input input { flex: 1; padding: 10px 12px; border-radius: 20px; border: 1px solid var(--border); }
.chat-input button { border: none; background: var(--magenta); color: #fff; border-radius: 20px; padding: 0 16px; }
.plan {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; background: #fff;
}
.plan .name { font-weight: 600; }
.plan .price { color: var(--magenta); font-weight: 700; }
.tag-login { font-size: 12px; color: var(--magenta); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
