  /* ---------- 灰盒基调：只用灰阶 ---------- */
  :root {
    --ink: #1a1a1a;
    --ink-2: #4a4a4a;
    --ink-3: #8a8a8a;
    --line: #c9c9c9;
    --line-soft: #e2e2e2;
    --surface: #f4f4f4;
    --surface-2: #ebebeb;
    --white: #fbfbfb;
    --space: #191a1c;
    --space-2: #232427;
    --radius: 10px;
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; height: 100%; }
  body {
    background: #dcdcdc;
    color: var(--ink);
    font: 14px/1.5 "PingFang SC", -apple-system, "Helvetica Neue", sans-serif;
    display: flex; align-items: center; justify-content: center;
  }
  #app {
    position: relative;
    width: min(100vw, 430px);
    height: min(100vh, 860px);
    background: var(--surface);
    overflow: hidden;
    border: 1px dashed var(--line);
  }
  .screen { position: absolute; inset: 0; display: none; flex-direction: column; }
  .screen.active { display: flex; }

  .topbar {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--white);
    flex: 0 0 auto;
  }
  .topbar .title { font-weight: 600; font-size: 15px; }
  .topbar .spacer { flex: 1; }
  .btn {
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
  }
  .btn:active { background: var(--surface-2); }

  /* ================= 首页：宇宙空间 ================= */
  #screen-home { background: var(--space); }
  .space {
    position: relative;
    flex: 1;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
  }
  .space.dragging { cursor: grabbing; }
  /* 远景星点：两层不同速度制造纵深 */
  .starfield {
    position: absolute; inset: -20% 0;
    will-change: transform;
  }
  .starfield.far {
    background-image:
      radial-gradient(1.5px 1.5px at 30px 40px, rgba(255,255,255,.55) 50%, transparent 51%),
      radial-gradient(1.5px 1.5px at 120px 180px, rgba(255,255,255,.35) 50%, transparent 51%),
      radial-gradient(1px 1px at 200px 90px, rgba(255,255,255,.5) 50%, transparent 51%),
      radial-gradient(1.5px 1.5px at 260px 240px, rgba(255,255,255,.3) 50%, transparent 51%);
    background-size: 320px 320px;
  }
  .starfield.near {
    background-image:
      radial-gradient(2px 2px at 60px 120px, rgba(255,255,255,.7) 50%, transparent 51%),
      radial-gradient(2.5px 2.5px at 210px 60px, rgba(255,255,255,.45) 50%, transparent 51%);
    background-size: 420px 420px;
  }
  .world {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2300px;
    will-change: transform;
  }
  .hud {
    position: absolute; left: 0; right: 0; top: 0;
    display: flex; align-items: center;
    padding: 12px 14px 26px;
    color: #ededed;
    z-index: 8;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(25,26,28,1) 58%, rgba(25,26,28,0));
  }
  .hud .title { font-weight: 600; font-size: 15px; }
  .hud .spacer { flex: 1; }
  .hud .btn {
    pointer-events: auto;
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.28);
    color: #f2f2f2;
  }
  .hud .btn:active { background: rgba(255,255,255,.2); }

  .ship-fixed {
    position: absolute;
    left: 18px; bottom: 88px;
    transform: translateY(0);
    z-index: 7;
    pointer-events: none;
    opacity: .95;
    animation: hover 3.6s ease-in-out infinite;
  }
  @keyframes hover {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }

  .planet-node {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer;
    color: #d8d8d8;
    background: none; border: none; padding: 0;
  }
  .planet-node .disc {
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.45);
    background:
      repeating-linear-gradient(45deg, rgba(255,255,255,.10), rgba(255,255,255,.10) 5px, rgba(255,255,255,.03) 5px, rgba(255,255,255,.03) 12px),
      radial-gradient(circle at 34% 30%, #4a4b4f, #2a2b2e 70%);
    box-shadow: inset -10px -12px 22px rgba(0,0,0,.55), 0 0 0 6px rgba(255,255,255,.03);
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .planet-node:active .disc { transform: scale(.96); }
  .planet-node.near .disc { box-shadow: inset -16px -18px 30px rgba(0,0,0,.6), 0 0 0 10px rgba(255,255,255,.04); }
  .planet-node .p-label {
    font-size: 12px; letter-spacing: .04em; white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
  }
  .planet-node.done .p-label::after { content: " ✓"; }
  .planet-node .p-sub { font-size: 11px; color: #9a9a9a; }

  /* 底部压暗，让"半颗星球"沉入画面边缘，同时托住提示条 */
  .space::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(25,26,28,.95), rgba(25,26,28,0));
    pointer-events: none;
    z-index: 4;
  }

  .space-hint {
    position: absolute; left: 14px; bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(25,26,28,.78);
    border: 1px solid rgba(255,255,255,.12);
    font-size: 12px; color: #a8a8a8;
    white-space: nowrap;
    z-index: 8; pointer-events: none;
    transition: opacity .2s ease;
  }

  /* ================= 星球内：球面弧线 ================= */
  .sky-ship { flex: 0 0 auto; display: flex; justify-content: center; padding: 6px 0 0; background: linear-gradient(#fbfbfb, #f4f4f4); }
  .surface {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    background: #fafafa;
    touch-action: none;
    cursor: grab;
  }
  .surface.dragging { cursor: grabbing; }
  .surface svg.ground { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .spot {
    position: absolute;
    transform-origin: 50% 50%;
    border: 1px dashed var(--ink-3);
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    color: var(--ink-2);
    font-size: 12px;
    padding: 9px 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity .18s, transform .18s, background .18s, color .18s;
    display: flex; align-items: center; gap: 5px;
  }
  .spot .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--ink-3);
    transition: background .18s;
  }
  .spot:active { transform-origin: 50% 50%; }
  .spot.dug {
    border-style: solid;
    border-color: var(--ink-2);
    background: var(--ink);
    color: #fff;
    opacity: .78;
  }
  .spot.dug .dot { background: #fff; }
  .spot.dug::after { content: "已翻找"; font-size: 11px; opacity: .85; }
  .spot.dug .name { display: none; }

  .drop-float {
    position: absolute;
    font-size: 13px; font-weight: 600; color: var(--ink);
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
  }
  @keyframes floatUp {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -56px); }
  }
  .sheep-pop {
    position: absolute; left: 50%; top: 34%;
    transform: translate(-50%, -50%) scale(.6);
    opacity: 0;
    animation: popIn .5s ease-out forwards;
    pointer-events: none;
  }
  @keyframes popIn { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

  /* ================= 底部托盘 ================= */
  .tray {
    flex: 0 0 auto;
    border-top: 1px solid var(--line-soft);
    background: var(--white);
    padding: 10px 12px 14px;
  }
  .tray-label { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; margin-bottom: 6px; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
  .chip {
    border: 1px solid var(--line); border-radius: 999px;
    padding: 5px 10px; font-size: 12px;
    background: var(--surface); cursor: pointer;
  }
  .chip:active { background: var(--ink); color: #fff; }
  .chips .empty { color: var(--ink-3); font-size: 12px; }
  .slots { display: flex; gap: 8px; margin-top: 10px; }
  .slot {
    flex: 1; height: 46px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--ink-3);
    cursor: pointer;
  }
  .slot.filled { border-style: solid; border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); }
  .recipe-hint { margin-top: 8px; font-size: 12px; color: var(--ink-2); }

  /* ================= 图鉴 ================= */
  .dex-list { flex: 1; overflow-y: auto; padding: 12px 12px 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .dex-card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--white); padding: 10px; }
  .dex-card .d-name { font-weight: 600; font-size: 13px; }
  .dex-card .d-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
  .dex-card .d-recipe { font-size: 11px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
  .dex-card.got { border-color: var(--ink-2); }
  .dex-card .d-sheep { opacity: .25; }
  .dex-card.got .d-sheep { opacity: 1; }

  /* ================= 反馈 ================= */
  #toast {
    position: absolute; left: 50%; top: 44%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(26,26,26,.92); color: #fff;
    font-size: 13px; padding: 8px 14px; border-radius: 999px;
    opacity: 0; pointer-events: none;
    transition: opacity .18s, transform .18s;
    z-index: 40; max-width: 80%; text-align: center;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
