:root {
    --primary: #4d8d4c;
    --primary-dark: #3d753c;
    --primary-light: #edf5ed;
    --danger: #e5484d;
    --warning: #f5a623;
    --success: #2e9e5b;
    --text: #333;
    --text-2: #888;
    --text-3: #bbb;
    --bg: #f5f7f8;
    --card: #fff;
    --border: #eee;
    --radius: 12px;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text); font-size: 15px;
    max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative;
  }
  .navbar {
    position: relative;
    background: transparent;
    color: var(--text); padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .navbar .title { font-size: 17px; font-weight: 600; }
  .navbar .back { font-size: 24px; line-height: 1; cursor: pointer; width: 30px; color: var(--text); }
  .navbar .nav-action { font-size: 13px; cursor: pointer; background: #f0f3f0; color: var(--text-2); padding: 6px 14px; border-radius: 20px; }
  /* 回到小程序首页的悬浮按钮 */
  .home-fab {
    position: fixed; right: 14px; bottom: 30px; z-index: 300;
    width: 46px; height: 46px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.14);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; user-select: none; -webkit-user-select: none;
  }
  .home-fab:active { opacity: .8; }
  .home-fab .ic { font-size: 17px; line-height: 1; }
  .home-fab .tx { font-size: 9px; color: var(--text-2); margin-top: 2px; line-height: 1; }
  .page { display: none; padding-bottom: 40px; animation: fadeIn .25s ease; }
  .page.active { display: block; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }
  .card { background: var(--card); margin: 12px; border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
  .sec-title { display: flex; align-items: center; font-size: 16px; font-weight: 700; margin-bottom: 4px; }
  .sec-title::before { content: ""; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; margin-right: 8px; }
  .field { margin-top: 14px; }
  .field label { display: block; font-size: 14px; color: var(--text); margin-bottom: 8px; font-weight: 500; }
  .field label .req { color: var(--danger); margin-right: 2px; }
  .field .hint { font-size: 12px; color: var(--text-3); margin-bottom: 8px; margin-top: -4px; }
  .input {
    width: 100%; border: 1px solid var(--border); border-radius: 8px;
    padding: 11px 12px; font-size: 15px; background: #fafbfc; outline: none;
    transition: border-color .2s; font-family: inherit;
  }
  .input:focus { border-color: var(--primary); background: #fff; }
  .input::placeholder { color: var(--text-3); }
  textarea.input { min-height: 90px; resize: vertical; }
  .code-row { display: flex; gap: 10px; align-items: stretch; }
  .code-row .input { flex: 1; }
  .code-btn {
    flex-shrink: 0; border: 1px solid var(--primary); background: #fff; color: var(--primary);
    border-radius: 8px; padding: 0 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  }
  .code-btn:disabled { color: var(--text-3); border-color: var(--border); cursor: default; }
  .upload-row { display: flex; gap: 14px; flex-wrap: wrap; }
  .upload-box {
    width: 92px; height: 92px; border: 1px dashed #d5dbe0; border-radius: 10px;
    background: #fafbfc; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-2); font-size: 12px; cursor: pointer; position: relative; overflow: hidden;
    transition: border-color .2s;
  }
  .upload-box:active { border-color: var(--primary); }
  .upload-box .cam { font-size: 22px; margin-bottom: 4px; }
  .upload-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .upload-box .del {
    position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 20px; text-align: center; z-index: 2;
  }
  .upload-col .cap { font-size: 12px; color: var(--text-2); text-align: center; margin-top: 5px; }
  .btn {
    display: block; width: 100%; border: none; border-radius: 24px;
    background: linear-gradient(135deg, #5a9c59, #417a40); color: #fff;
    font-size: 16px; font-weight: 600; padding: 13px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(77,141,76,.35); transition: opacity .2s;
    font-family: inherit;
  }
  .btn:active { opacity: .85; }
  .btn:disabled { opacity: .55; }
  .btn.plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); box-shadow: none; }
  .btn.danger { background: linear-gradient(135deg, #ff6b6f, #e5484d); box-shadow: 0 4px 12px rgba(229,72,77,.3); }
  .btn.small { width: auto; padding: 8px 20px; font-size: 14px; border-radius: 18px; display: inline-block; }
  .agree-row { display: flex; align-items: flex-start; gap: 8px; margin: 20px 4px 14px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
  .agree-row input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
  .leader-card { display: flex; align-items: center; gap: 12px; background: #fff; margin: 12px; padding: 14px; border-radius: var(--radius); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
  .leader-card .avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: var(--primary-light); flex-shrink: 0; }
  .leader-card .avatar.placeholder { display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 22px; font-weight: 700; }
  .leader-card .info { flex: 1; min-width: 0; }
  .leader-card .name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
  .badge-cert { font-size: 10px; color: var(--primary); background: var(--primary-light); border-radius: 4px; padding: 2px 6px; font-weight: 500; }
  .badge-cert.fa { color: #d97706; background: #fef3e2; }
  .leader-card .meta { font-size: 12px; color: var(--text-2); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .leader-card .arrow { color: #ccc; }
  .empty { text-align: center; color: var(--text-3); padding: 60px 0; font-size: 14px; }
  .empty .icon { font-size: 44px; margin-bottom: 10px; }
  .detail-head { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #5a9c59, #417a40); margin: 12px; border-radius: var(--radius); padding: 20px 16px; color: #fff; }
  .detail-head img.avatar, .detail-head .avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.6); }
  .detail-head .avatar.placeholder { display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; background: rgba(255,255,255,.2); }
  .detail-head .name { font-size: 18px; font-weight: 700; }
  .detail-head .sub { font-size: 12px; opacity: .9; margin-top: 4px; }
  .kv { display: flex; padding: 11px 0; border-bottom: 1px solid #f4f5f6; font-size: 14px; }
  .kv:last-child { border-bottom: none; }
  .kv .k { width: 96px; color: var(--text-2); flex-shrink: 0; }
  .kv .v { flex: 1; word-break: break-all; }
  .kv .v img { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; margin: 4px 8px 4px 0; cursor: zoom-in; border: 1px solid var(--border); }
  .sec-block { margin-top: 18px; }
  .sec-block .sec-title { font-size: 15px; }
  .status { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 500; }
  .status.pending { color: var(--warning); background: #fef5e5; }
  .status.approved { color: var(--success); background: #e7f6ec; }
  .status.rejected { color: var(--danger); background: #fdeced; }
  .admin-card { background: #fff; margin: 12px; border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
  .admin-card .top { display: flex; align-items: center; gap: 10px; }
  .admin-card .top img.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
  .admin-card .top .avatar.ph { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; }
  .admin-card .uname { font-weight: 600; font-size: 15px; }
  .admin-card .time { font-size: 11px; color: var(--text-3); margin-top: 3px; }
  .admin-card .btns { display: flex; gap: 10px; margin-top: 12px; }
  .admin-card .btns .btn { flex: 1; padding: 9px; font-size: 14px; border-radius: 18px; box-shadow: none; }
  .auth-wrap { padding: 24px 24px; }
  .auth-logo { text-align: center; margin: 18px 0 24px; }
  .auth-logo .logo-circle { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #5a9c59, #417a40); color: #fff; font-size: 34px; line-height: 72px; margin: 0 auto 12px; box-shadow: 0 6px 16px rgba(77,141,76,.35); }
  .auth-logo .t1 { font-size: 20px; font-weight: 700; }
  .auth-logo .t2 { font-size: 13px; color: var(--text-2); margin-top: 6px; }
  .tabs { display: flex; margin-bottom: 20px; border-radius: 10px; background: #eef1f3; padding: 4px; }
  .tabs .tab { flex: 1; text-align: center; padding: 9px; border-radius: 8px; font-size: 15px; color: var(--text-2); cursor: pointer; transition: all .2s; }
  .tabs .tab.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
  .mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: none; align-items: center; justify-content: center; }
  .mask.show { display: flex; }
  .dialog { background: #fff; border-radius: 14px; width: 84%; max-width: 360px; padding: 22px 20px; }
  .dialog h3 { font-size: 16px; margin-bottom: 12px; text-align: center; }
  .dialog textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; min-height: 70px; padding: 10px; font-size: 14px; outline: none; resize: vertical; font-family: inherit; }
  .dialog .btns { display: flex; gap: 10px; margin-top: 16px; }
  .dialog .btns .btn { padding: 10px; font-size: 14px; border-radius: 20px; box-shadow: none; }
  #imgViewer { background: rgba(0,0,0,.85); }
  #imgViewer img { max-width: 94%; max-height: 88%; border-radius: 8px; }
  #toast {
    position: fixed; top: 45%; left: 50%; transform: translate(-50%,-50%);
    background: rgba(0,0,0,.75); color: #fff; padding: 12px 22px; border-radius: 10px;
    font-size: 14px; z-index: 300; display: none; max-width: 75%; text-align: center; line-height: 1.5;
  }
  .reason-tip { font-size: 12px; color: var(--danger); background: #fdeced; border-radius: 8px; padding: 8px 10px; margin-top: 10px; line-height: 1.5; }
  .admin-banner { background: #fffbe8; color: #9a7b1e; font-size: 12px; padding: 8px 14px; text-align: center; }
  .invite-box { background: #f0fbfc; border: 1px solid #d3eef2; border-radius: 10px; padding: 14px; margin-top: 18px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
  .code-chip { display: inline-block; background: #fff; border: 1px dashed var(--primary); color: var(--primary); font-weight: 700; letter-spacing: 1px; padding: 6px 12px; border-radius: 8px; margin-top: 8px; font-size: 15px; }
  #boot { position: fixed; inset: 0; background: #fff; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-2); font-size: 14px; }
  .spinner { width: 30px; height: 30px; border: 3px solid #edf5ed; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 12px; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .loading-inline { text-align: center; color: var(--text-3); padding: 30px 0; font-size: 13px; }
