    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      background:
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(99,102,241,0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(34,197,94,0.05) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 80%, rgba(245,158,11,0.04) 0%, transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
      color: #323233;
      font-size: 14px;
      line-height: 1.4;
      padding-bottom: 80px;
      min-height: 100vh;
    }
    .container { max-width: 430px; margin: 0 auto; }
    .hide { display: none !important; }

    .top-bar {
      background: rgba(255,255,255,0.95);
      backdrop-filter: blur(6px);
      padding: 12px 16px;
      position: sticky;
      top: 0;
      z-index: 100;
      border-bottom: 1px solid #f2f3f5;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .top-bar .back {
      font-size: 15px;
      color: #323233;
      cursor: pointer;
      padding: 4px 8px 4px 0;
      display: none;
    }
    .top-bar .back.visible { display: block; }
    .top-bar .title {
      font-size: 16px;
      font-weight: 600;
      flex: 1;
    }

    .app-logo {
      width: 36px;
      height: 36px;
      border-radius: 50% 50% 52% 52% / 60% 60% 40% 40%;
      border: 2px solid #f59e0b;
      box-shadow: 0 0 8px rgba(245,158,11,0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      background: #fffbeb;
      flex-shrink: 0;
    }
    .app-title {
      font-size: 18px;
      font-weight: 700;
      color: #6366f1;
      text-shadow: 0 1px 2px rgba(99,102,241,0.15);
      letter-spacing: 0.5px;
    }
    .search-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: none;
      background: linear-gradient(135deg, #6366f1, #4f46e5);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.15s ease;
      flex-shrink: 0;
    }
    .search-btn:hover { transform: scale(1.08); }
    .search-btn:active { transform: scale(0.96); }

    .search-box {
      background: #f2f3f5;
      border-radius: 20px;
      padding: 8px 14px;
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
    }
    .search-box input {
      flex: 1;
      border: none;
      background: transparent;
      font-size: 14px;
      outline: none;
      color: #323233;
    }
    .search-box input::placeholder { color: #969799; }

    .select-box {
      background: #f2f3f5;
      border-radius: 20px;
      padding: 8px 14px;
      display: flex;
      align-items: center;
      margin-bottom: 10px;
    }
    .select-box select {
      flex: 1;
      border: none;
      background: transparent;
      font-size: 14px;
      outline: none;
      color: #323233;
      appearance: auto;
    }

    .search-results {
      position: absolute;
      top: 52px;
      left: 16px;
      right: 16px;
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.1);
      max-height: 320px;
      overflow-y: auto;
      z-index: 99;
      display: none;
    }
    .search-results.active { display: block; }
    .search-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      border-bottom: 1px solid #f2f3f5;
      cursor: pointer;
    }
    .search-item:active { background: #f2f3f5; }
    .search-item img {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      object-fit: contain;
      background: #f7f8fa;
    }

    .card {
      background: #fff;
      border-radius: 12px;
      margin: 12px 16px;
      padding: 16px;
      box-shadow: 0 4px 14px rgba(99,102,241,0.08);
    }
    .card-title {
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .group-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin: 0 16px 16px;
    }
    .group-card {
      background: #fff;
      border-radius: 12px;
      padding: 14px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
      border: 1px solid #f2f3f5;
    }
    .group-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(99,102,241,0.1);
    }
    .group-card:active { transform: scale(0.98); }
    .group-card-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }
    .group-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
    }
    .group-name { font-size: 14px; font-weight: 600; }
    .group-count { font-size: 12px; color: #969799; }
    .group-preview {
      display: flex;
      gap: 6px;
      margin-top: 8px;
      flex-wrap: wrap;
    }
    .group-preview .img-wrap {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      background: #f7f8fa;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .group-preview img {
      width: 90%;
      height: 90%;
      object-fit: contain;
    }

    [data-group="动物组"] { background: #fff7ed; }
    [data-group="植物组"] { background: #f0fdf4; }
    [data-group="海洋组"] { background: #eff6ff; }
    [data-group="天空组"] { background: #f5f3ff; }
    [data-group="精灵组"] { background: #fdf4ff; }
    [data-group="龙族组"] { background: #fef2f2; }
    [data-group="恶魔组"] { background: #fafaf9; }
    [data-group="机械组"] { background: #f8fafc; }
    [data-group="不死组"] { background: #f7fee7; }
    [data-group="大地组"] { background: #fffbeb; }
    [data-group="萌系组"] { background: #fff1f2; }
    [data-group="力量组"] { background: #fff7ed; }
    [data-group="守护组"] { background: #ecfeff; }
    [data-group="无法孵蛋"] { background: #f3f4f6; }

    .pet-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px 8px;
      padding: 16px;
    }
    .pet-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      padding: 6px 2px;
      border-radius: 10px;
    }
    .pet-item:active { background: #f2f3f5; }
    .pet-item .img-wrap {
      width: 56px;
      height: 56px;
      border-radius: 10px;
      background: #f7f8fa;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #f2f3f5;
    }
    .pet-item img {
      width: 90%;
      height: 90%;
      object-fit: contain;
    }
    .pet-item .name {
      font-size: 11px;
      color: #646566;
      text-align: center;
      width: 100%;
      height: 28px;
      line-height: 14px;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .selected-pet {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 14px;
    }
    .selected-pet .img-wrap {
      width: 64px;
      height: 64px;
      border-radius: 12px;
      background: #f7f8fa;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #f2f3f5;
      flex-shrink: 0;
    }
    .selected-pet img {
      width: 90%;
      height: 90%;
      object-fit: contain;
    }
    .selected-pet .info { flex: 1; min-width: 0; }
    .selected-pet .name {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 4px;
    }
    .selected-pet .no {
      font-size: 12px;
      color: #969799;
    }

    .tag-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      flex-shrink: 0;
      max-width: 130px;
      justify-content: flex-end;
    }
    .tag {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
    }
    .tag-egg {
      background: #eef2ff;
      color: #6366f1;
    }
    .tag-ban {
      background: #ffebee;
      color: #ee0a24;
    }

    .status-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      border-radius: 8px;
      font-size: 13px;
      margin-bottom: 14px;
    }
    .status-ok { background: #f0fdf4; color: #22c55e; }
    .status-ban { background: #fff2f0; color: #ff4d4f; }

    .section-subtitle {
      font-size: 13px;
      color: #969799;
      margin-bottom: 10px;
    }

    .partner-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px 6px;
    }
    .partner-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      padding: 6px 2px;
      border-radius: 10px;
      cursor: pointer;
    }
    .partner-item:active { background: #f2f3f5; }
    .partner-item .img-wrap {
      width: 48px;
      height: 48px;
      border-radius: 10px;
      background: #f7f8fa;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #f2f3f5;
    }
    .partner-item img {
      width: 90%;
      height: 90%;
      object-fit: contain;
    }
    .partner-item .p-name {
      font-size: 11px;
      color: #646566;
      text-align: center;
      width: 100%;
      height: 28px;
      line-height: 14px;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .footer-note {
      position: fixed;
      bottom: 62px;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 430px;
      text-align: center;
      font-size: 10px;
      color: #c8c9cc;
      padding: 4px 0;
      pointer-events: none;
      z-index: 99;
    }

    .tab-bar {
      position: fixed;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 430px;
      background: #fff;
      border-top: 1px solid #f2f3f5;
      display: flex;
      justify-content: center;
      padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
      z-index: 100;
      box-sizing: border-box;
    }
    .tab-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      padding: 4px 0;
      flex: 1;
      cursor: pointer;
      color: #969799;
      font-size: 11px;
      position: relative;
    }
    .tab-item.active {
      color: #6366f1;
    }
    .tab-item.active::after {
      content: "";
      position: absolute;
      bottom: 2px;
      left: 50%;
      transform: translateX(-50%);
      width: 18px;
      height: 3px;
      border-radius: 2px;
      background: #f59e0b;
    }
    .tab-icon { font-size: 20px; }

    .quick-pets {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding-bottom: 4px;
    }
    .quick-pets::-webkit-scrollbar { display: none; }
    .quick-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 8px;
      min-width: 64px;
      background: #f7f8fa;
      border-radius: 10px;
      cursor: pointer;
    }
    .quick-item:active { opacity: 0.7; }
    .quick-item .img-wrap {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      background: #fff;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .quick-item img {
      width: 90%;
      height: 90%;
      object-fit: contain;
    }
    .quick-item span {
      font-size: 11px;
      color: #646566;
      white-space: nowrap;
    }

    .empty-state {
      text-align: center;
      padding: 50px 20px;
      color: #969799;
    }
    .empty-state .icon {
      font-size: 56px;
      margin-bottom: 10px;
      opacity: 0.35;
    }
    .empty-state p { font-size: 13px; }

    @keyframes egg-shake {
      0%, 100% { transform: rotate(0deg); }
      20% { transform: rotate(-6deg); }
      40% { transform: rotate(6deg); }
      60% { transform: rotate(-4deg); }
      80% { transform: rotate(4deg); }
    }
    .egg-shake {
      animation: egg-shake 0.5s ease-in-out;
      display: inline-block;
    }

    .multi-tag-note {
      font-size: 11px;
      color: #969799;
      margin-top: -8px;
      margin-bottom: 10px;
    }

    /* 异色传递 */
    .shiny-header {
      padding: 16px;
      text-align: center;
    }
    .shiny-header h2 {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 4px;
    }
    .shiny-header p {
      font-size: 12px;
      color: #969799;
    }
    .owned-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }
    .owned-chip {
      display: flex;
      align-items: center;
      gap: 6px;
      background: #eef2ff;
      color: #6366f1;
      padding: 6px 10px;
      border-radius: 20px;
      font-size: 13px;
    }
    .owned-chip .gender {
      font-size: 11px;
      background: #fff;
      padding: 2px 6px;
      border-radius: 10px;
    }
    .owned-chip .close {
      cursor: pointer;
      font-size: 12px;
      opacity: 0.7;
    }
    .owned-chip .close:hover { opacity: 1; }

    .gender-select {
      display: flex;
      gap: 8px;
      margin-top: 8px;
    }
    .gender-btn {
      flex: 1;
      padding: 8px;
      border: 1px solid #ebedf0;
      background: #fff;
      border-radius: 8px;
      font-size: 13px;
      cursor: pointer;
    }
    .gender-btn.active {
      border-color: #6366f1;
      background: #eef2ff;
      color: #6366f1;
      font-weight: 500;
    }

    .stat-row {
      display: flex;
      gap: 10px;
      margin-bottom: 16px;
    }
    .stat-box {
      flex: 1;
      background: #f7f8fa;
      border-radius: 10px;
      padding: 12px;
      text-align: center;
    }
    .stat-box .num {
      font-size: 20px;
      font-weight: 700;
      color: #323233;
      margin-bottom: 2px;
    }
    .stat-box .label {
      font-size: 11px;
      color: #969799;
    }
    .stat-gold {
      font-size: 20px;
      color: #6366f1;
      font-weight: 700;
    }

    .shiny-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px 6px;
    }
    .shiny-pick-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 6px 4px;
    }
    .shiny-pick-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      padding: 2px;
      border-radius: 6px;
      cursor: pointer;
      background: #f7f8fa;
      border: 1.5px solid transparent;
      transition: all 0.1s;
      position: relative;
    }
    .shiny-pick-item:active { opacity: 0.8; }
    .shiny-pick-item.selected-male { border-color: #6366f1; background: #eef2ff; }
    .shiny-pick-item.selected-female { border-color: #ff4d4f; background: #fff1f2; }
    .shiny-pick-item.selected-both {
      border-color: #f59e0b;
      background: #fffbeb;
    }
    .shiny-pick-item .img-wrap {
      width: 36px;
      height: 36px;
      border-radius: 5px;
      background: #fff;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
    }
    .shiny-pick-item img {
      width: 90%;
      height: 90%;
      object-fit: contain;
    }
    .shiny-pick-item .name {
      font-size: 10px;
      color: #646566;
      text-align: center;
      width: 100%;
      height: 14px;
      line-height: 14px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    .shiny-pick-badges {
      position: absolute;
      bottom: 1px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 1px;
    }
    .shiny-pick-badge {
      font-size: 8px;
      padding: 0 2px;
      border-radius: 3px;
      color: #fff;
      line-height: 10px;
      font-weight: 500;
    }
    .shiny-pick-badge.male { background: #6366f1; }
    .shiny-pick-badge.female { background: #ff4d4f; }
    .shiny-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 6px 2px;
      border-radius: 10px;
      cursor: pointer;
      position: relative;
    }
    .shiny-item.dimmed { opacity: 0.4; }
    .shiny-item.highlight {
      background: #fffbe6;
      border: 1px solid #ffd591;
    }
    .shiny-item .img-wrap {
      width: 48px;
      height: 48px;
      border-radius: 10px;
      background: #f7f8fa;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #f2f3f5;
    }
    .shiny-item img {
      width: 90%;
      height: 90%;
      object-fit: contain;
    }
    .shiny-item .name {
      font-size: 11px;
      color: #646566;
      text-align: center;
      width: 100%;
      height: 26px;
      line-height: 13px;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .shiny-badge {
      position: absolute;
      top: 2px;
      right: 2px;
      font-size: 10px;
      background: #ff4d4f;
      color: #fff;
      padding: 1px 4px;
      border-radius: 8px;
    }

    .chain-box {
      background: #f7f8fa;
      border-radius: 10px;
      padding: 12px;
      margin-top: 10px;
    }
    .chain-step {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
      font-size: 13px;
    }
    .chain-step:last-child { margin-bottom: 0; }
    .chain-step img {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      object-fit: contain;
      background: #fff;
    }
    .arrow {
      color: #969799;
      font-size: 12px;
    }

    .chain-detail-box {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 10px;
    }
    .chain-detail-step {
      display: flex;
      gap: 10px;
      background: #f7f8fa;
      border-radius: 10px;
      padding: 12px;
    }
    .step-badge {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      background: #6366f1;
      color: #fff;
      font-size: 12px;
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .step-body {
      flex: 1;
      min-width: 0;
    }
    .step-title {
      font-size: 13px;
      font-weight: 500;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .step-icon {
      width: 24px;
      height: 24px;
      border-radius: 6px;
      object-fit: contain;
      background: #fff;
    }
    .step-desc {
      font-size: 12px;
      color: #646566;
      line-height: 1.5;
    }

    .btn-primary {
      width: 100%;
      padding: 12px;
      background: linear-gradient(135deg, #6366f1, #4f46e5);
      color: #fff;
      border: none;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      margin-top: 10px;
      transition: box-shadow 0.15s ease;
    }
    .btn-primary:hover {
      box-shadow: 0 4px 14px rgba(99,102,241,0.35);
    }
    .btn-primary:active { opacity: 0.9; }

    .layer-group {
      margin-bottom: 14px;
    }
    .layer-title {
      font-size: 12px;
      color: #969799;
      margin-bottom: 8px;
      padding-left: 4px;
    }

    /* 树状图样式（横向紧凑） */
    .tree-layer { margin-bottom: 10px; }
    .tree-layer-title {
      font-size: 12px;
      color: #969799;
      margin-bottom: 6px;
      text-align: center;
    }
    .tree-mini-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      justify-content: center;
    }
    .tree-mini {
      display: flex;
      align-items: center;
      gap: 4px;
      background: #fffbeb;
      border: 1px solid #78350f;
      border-radius: 8px;
      padding: 6px 8px;
      font-size: 10px;
    }
    .tree-mini img {
      width: 24px;
      height: 24px;
      border-radius: 4px;
      object-fit: contain;
      background: #fff;
      box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
      flex-shrink: 0;
    }
    .tree-mini span {
      color: #646566;
      white-space: nowrap;
    }
    .tree-mini .arrow {
      color: #969799;
      font-size: 11px;
      padding: 0 1px;
    }
    .tree-mini .result {
      font-weight: 500;
      color: #323233;
    }

    .shiny-tag {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: linear-gradient(135deg, #fff7e6 0%, #ffecb3 100%);
      color: #d46b08;
      border: 1px solid #ffd591;
    }
