/* 「阿阿集团」网页版 · 深空星云主题（对照原 app.wxss） */

:root {
  --bg: #10152f;
  --bg-nav: #141a3d;
  --bg-tab: #12173a;
  --card: rgba(30, 38, 80, 0.58);
  --card-solid: #1e2650;
  --input-bg: rgba(13, 18, 44, 0.6);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9edf9;
  --text-1: #f0e9d6;
  --text-2: #d5dbef;
  --text-3: #b9c1e0;
  --muted: #98a2c7;
  --weak: #6f7798;
  --ph: #7a85b4;
  --gold: #f5c86a;
  --gold-deep: #e2a93f;
  --gold-dark-text: #2a1d05;
  --green: #7be3a8;
  --red: #ff9a8d;
  --pink: #ff9db4;
  --blue: #7fd4f9;
  --violet: #9db0ff;
  --radius: 14px;
  --tabbar-h: 58px;
}

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

html, body { height: 100%; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
/* 星云背景：纯 CSS 模拟 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(60vw 40vh at 15% 8%, rgba(84, 66, 150, 0.28), transparent 60%),
    radial-gradient(50vw 36vh at 88% 18%, rgba(46, 90, 160, 0.22), transparent 60%),
    radial-gradient(70vw 50vh at 50% 100%, rgba(24, 34, 88, 0.5), transparent 70%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 34% 12%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 28%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 76% 9%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 90% 34%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 22% 54%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 66% 62%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 44% 78%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(1px 1px at 84% 84%, rgba(255,255,255,0.25), transparent 60%);
}

#app { max-width: 560px; margin: 0 auto; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); min-height: 100%; }

.page-body { padding: 0 12px; }
.tab-page { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.footer { text-align: center; color: var(--weak); font-size: 12px; padding: 24px 0 8px; }

/* ---------- 顶栏（子页面） ---------- */
.navbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; height: calc(50px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0;
  background: linear-gradient(rgba(13,17,44,0.96), rgba(13,17,44,0.82));
  backdrop-filter: blur(8px);
}
.navbar .back {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 32px; padding: 0 10px;
  border-radius: 16px; background: rgba(255,255,255,0.1);
  color: var(--text-2); font-size: 18px; cursor: pointer; user-select: none;
}
.navbar .title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 16px; font-weight: 600; color: var(--text-1);
  max-width: 55%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* ---------- tabBar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; z-index: 40; width: 100%; max-width: 560px;
  display: flex; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-tab); border-top: 1px solid var(--line);
}
.tabbar[hidden] { display: none; }
.tab {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: #8b94bc; text-decoration: none; font-size: 11px; cursor: pointer;
}
.tab .tab-icon { font-size: 20px; line-height: 1; filter: grayscale(0.4) opacity(0.75); }
.tab.active { color: var(--gold); }
.tab.active .tab-icon { filter: none; }
.tab-badge {
  position: absolute; top: 6px; right: calc(50% - 20px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #ff5f57; color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}

/* ---------- 卡片 / 区块 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 3px 12px rgba(5, 8, 26, 0.35);
}
.section-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 10px; }
.section-title.row { display: flex; align-items: center; justify-content: space-between; }
.divider { height: 1px; background: var(--line); margin: 10px 0; }
.muted { color: var(--muted); font-size: 12px; }
.weak { color: var(--weak); font-size: 12px; }
.link { color: var(--gold); font-size: 13px; cursor: pointer; }
.empty { padding: 36px 0; text-align: center; color: #8b94bc; font-size: 14px; }
.empty-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.preserve { white-space: pre-wrap; word-break: break-word; }

.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-1 { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 16px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; user-select: none;
  color: var(--text); background: rgba(255,255,255,0.08); transition: opacity 0.15s;
}
.btn:active { opacity: 0.75; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: var(--gold-dark-text); }
.btn-outline { background: transparent; border: 1px solid rgba(245, 200, 106, 0.6); color: var(--gold); }
.btn-danger { background: rgba(255, 110, 110, 0.16); color: var(--red); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text-3); font-weight: 400; }
.btn-disabled { background: #3a4166; color: var(--weak); cursor: not-allowed; }
.btn-sm { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12px; font-weight: 500; }
.btn-block { display: flex; width: 100%; }
.btn-mini { height: 26px; padding: 0 10px; border-radius: 8px; font-size: 11px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  font-size: 11px; line-height: 18px; white-space: nowrap;
  background: rgba(255,255,255,0.08); color: var(--muted);
}
.tag-l1 { background: rgba(255,255,255,0.08); color: var(--muted); }
.tag-l2 { background: rgba(127, 212, 249, 0.15); color: var(--blue); }
.tag-l3 { background: rgba(245, 200, 106, 0.16); color: var(--gold); }
.tag-l4 { background: rgba(255, 157, 180, 0.16); color: var(--pink); }
.tag-admin { background: #f0bc60; color: #4a3305; }
.tag-ongoing { background: rgba(123, 227, 168, 0.15); color: var(--green); }
.tag-notStarted { background: rgba(157, 176, 255, 0.15); color: var(--violet); }
.tag-ended { background: rgba(245, 200, 106, 0.14); color: var(--gold); }
.tag-settled { background: rgba(255,255,255,0.08); color: var(--weak); }
.tag-warning { background: rgba(255, 154, 141, 0.16); color: var(--red); }
.tag-badge-outline { border: 1px solid rgba(245, 200, 106, 0.5); color: var(--gold); background: transparent; }

/* ---------- 头像 ---------- */
.avatar, .avatar-sm, .avatar-lg {
  border-radius: 50%; background: rgba(255,255,255,0.1); object-fit: cover; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold); font-weight: 600; overflow: hidden;
}
.avatar { width: 42px; height: 42px; font-size: 16px; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-lg { width: 60px; height: 60px; font-size: 22px; }
.avatar img, .avatar-sm img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 12px; }
.form-label { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.form-input, .form-textarea {
  width: 100%; background: var(--input-bg);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-size: 15px; padding: 10px 12px;
  outline: none; font-family: inherit;
}
.form-input { height: 44px; }
.form-input:focus, .form-textarea:focus { border-color: rgba(245, 200, 106, 0.45); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--ph); }
.form-textarea { min-height: 96px; resize: vertical; }
.form-textarea.tall { min-height: 150px; }
.char-count { text-align: right; font-size: 11px; color: var(--weak); margin-top: 3px; }
.form-tip { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.form-tip.ok { color: var(--green); }
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 10px; height: 38px;
}
.search-box input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.search-box input::placeholder { color: var(--ph); }

/* 胶囊选择 */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 6px 14px; border-radius: 999px; font-size: 13px;
  background: rgba(255,255,255,0.08); color: var(--text-3); cursor: pointer; user-select: none;
  border: none;
}
.pill.active { background: var(--gold); color: var(--gold-dark-text); font-weight: 600; }

/* 开关 */
.switch { position: relative; width: 44px; height: 26px; border-radius: 13px; background: rgba(255,255,255,0.14); cursor: pointer; transition: background 0.15s; flex-shrink: 0; border: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch.on { background: var(--gold); }
.switch.on::after { left: 20px; }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 列表行 ---------- */
.cell { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.cell:last-child { border-bottom: none; }
.cell-arrow { color: var(--weak); font-size: 16px; flex-shrink: 0; }
.cell-icon { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }

/* ---------- 数字 ---------- */
.num { font-size: 20px; font-weight: 700; }
.num-points { color: var(--gold); }
.points-big { font-size: 28px; font-weight: 700; color: var(--gold); }
.delta-pos { color: var(--green); font-weight: 700; }
.delta-neg { color: var(--red); font-weight: 700; }

/* ---------- 排名徽章 ---------- */
.rank-no {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: rgba(255,255,255,0.1); color: var(--muted);
}
.rank-1 { background: var(--gold); color: var(--gold-dark-text); }
.rank-2 { background: #d5dbef; color: #1a2044; }
.rank-3 { background: #e8af87; color: #4a2405; }

/* ---------- 提示横幅 ---------- */
.banner-warning { background: rgba(255, 110, 110, 0.18); color: var(--red); font-size: 13px; padding: 10px 12px; border-radius: var(--radius); margin-bottom: 12px; }
.banner-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--gold-dark-text); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; cursor: pointer;
}
.banner-cta .t { font-weight: 700; font-size: 15px; }
.banner-cta .d { font-size: 12px; opacity: 0.85; }
.banner-cta .go { background: rgba(255,255,255,0.92); color: var(--gold-dark-text); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- 进度天数圆点 ---------- */
.day-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.day-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.day-dot.lit { background: var(--gold); }

/* ---------- 资源网格 ---------- */
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.res-item { background: rgba(13,18,44,0.45); border-radius: 10px; padding: 8px; text-align: center; }
.res-item .v { font-size: 17px; font-weight: 700; color: var(--gold); word-break: break-all; }
.res-item .v.neg { color: var(--red); }
.res-item .k { font-size: 11px; color: var(--muted); margin-top: 2px; }
.med-line { font-size: 12px; color: var(--muted); }
.med-line b { color: var(--text-2); font-weight: 500; }

/* ---------- 弹层 / 弹窗 / Toast ---------- */
.sheet-mask { position: fixed; inset: 0; z-index: 100; background: rgba(5, 8, 22, 0.62); }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; z-index: 101; width: 100%; max-width: 560px;
  background: linear-gradient(#1b2249, #12173a);
  border-radius: 18px 18px 0 0; border-top: 1px solid var(--line);
  max-height: 72vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.sheet-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.sheet-close { color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px; }
.sheet-body { overflow-y: auto; padding: 0 16px 16px; }

.dialog-mask { position: fixed; inset: 0; z-index: 110; background: rgba(5,8,22,0.62); display: flex; align-items: center; justify-content: center; padding: 24px; }
.dialog { width: 100%; max-width: 320px; background: var(--card-solid); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.dialog-title { text-align: center; font-weight: 600; font-size: 16px; color: var(--text-1); margin-bottom: 10px; }
.dialog-content { font-size: 14px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow-y: auto; }
.dialog-btns { display: flex; gap: 10px; margin-top: 16px; }
.dialog-btns .btn { flex: 1; height: 38px; }

#toast-layer { position: fixed; left: 50%; transform: translateX(-50%); top: 60px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: 80vw; }
.toast {
  background: rgba(10, 14, 36, 0.92); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 9px 14px;
  font-size: 13px; max-width: 80vw; text-align: center; word-break: break-all;
  box-shadow: 0 4px 16px rgba(5,8,26,0.5);
}
.toast.success { border-color: rgba(123, 227, 168, 0.4); color: var(--green); }
.toast.hint { border-color: rgba(245, 200, 106, 0.4); }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 24px 24px; max-width: 560px; margin: 0 auto; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .logo-icon { font-size: 52px; }
.auth-logo .t { font-size: 22px; font-weight: 700; color: var(--text-1); margin-top: 8px; }
.auth-logo .d { font-size: 13px; color: var(--muted); margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.auth-switch a { color: var(--gold); cursor: pointer; }

/* ---------- 其他 ---------- */
.chip { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; background: rgba(157, 176, 255, 0.15); color: var(--violet); }
.chip.gold { background: rgba(245, 200, 106, 0.14); color: var(--gold); }
.chip.pink { background: rgba(255, 157, 180, 0.14); color: var(--pink); }
.filter-bar { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.filter-item { flex: 1; text-align: center; padding: 9px 0; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.filter-item.active { background: var(--gold); color: var(--gold-dark-text); font-weight: 600; }
.fee-line { color: var(--gold); font-size: 12px; margin-top: 4px; }
.hr-fade { height: 16px; background: linear-gradient(rgba(13,17,44,0.8), transparent); }

input[type="date"], input[type="time"] { color-scheme: dark; }

/* 下拉选择：去掉原生外观后补一个箭头，并用深色展开列表 */
select.form-input {
  appearance: none; -webkit-appearance: none;
  color-scheme: dark;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2398a2c7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
select.form-input:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f5c86a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* 数字类输入：负号 / 小数点在部分手机键盘上没有，统一用全键盘，由前端校验 */
input[inputmode="numeric"], input[inputmode="decimal"] { font-variant-numeric: tabular-nums; }
