:root{
  --bg1:#0f1020;
  --bg2:#191b2f;
  --glass:rgba(255,255,255,.08);
  --card:rgba(255,255,255,.10);
  --border:rgba(255,255,255,.12);
  --text:#e8ebff;
  --muted:#b9bfdb;
  --primary:#8ab4ff;
  --primary-strong:#a7c3ff;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --radius-lg:22px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; color:var(--text); background:linear-gradient(120deg,#0b0d1b,#12142a 40%,#0b0d1b);
  font:16px/1.6 -apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","PingFang SC","Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans CJK SC",sans-serif;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  /* iOS 拖拽时减少回弹干扰 */
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(65,105,225,.25), transparent 60%),
    radial-gradient(1200px 800px at 10% 120%, rgba(255,105,180,.18), transparent 60%);
  pointer-events:none;
  filter:saturate(120%);
}

.app{min-height:100%; display:flex; flex-direction:column; gap:24px; padding:20px 16px 80px}
.app-header, .app-footer{max-width:1080px; width:100%; margin:0 auto}

.app-header{
  display:flex; align-items:center; justify-content:space-between;
}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:.3px}
.brand .dot{width:10px; height:10px; border-radius:50%; background:linear-gradient(45deg,#7aa2ff,#ff86c8); box-shadow:0 0 14px rgba(138,180,255,.8)}

.steps{display:flex; gap:8px; flex-wrap:wrap}
.step{
  padding:6px 10px; border-radius:999px; background:var(--glass); border:1px solid var(--border);
  color:var(--muted); font-size:13px; backdrop-filter: blur(8px);
}
.step.active{color:#0b1220; background:var(--primary); border-color:transparent}

.view{display:none}
.view.active{display:block}
.panel{
  max-width:1080px; margin:0 auto; background:var(--glass); border:1px solid var(--border);
  box-shadow:var(--shadow); border-radius:var(--radius-lg); padding:20px; backdrop-filter: blur(12px);
}
.panel h1,.panel h2{margin:4px 0 6px}
.panel .desc{color:var(--muted)}

.intro{display:flex; flex-direction:column; align-items:center; text-align:center; padding:48px 20px}
.intro h1{font-size:32px}
.intro p{max-width:560px}

.duo{display:grid; grid-template-columns:1fr; gap:16px; margin-top:16px}
@media(min-width:860px){ .duo{grid-template-columns:1fr 1fr} }

.list-block{background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:14px}
.list-block-head{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:10px}
.list-title{font-weight:700}
.hint{color:var(--muted); font-size:13px}

/* 重要：去掉 smooth，避免与拖拽自动滚动冲突 */
.list{
  min-height:220px; max-height:50vh; overflow:auto; padding:8px;
  border:1px dashed rgba(255,255,255,.15); border-radius:12px;
  display:flex; flex-direction:column; gap:10px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.list.centered{justify-content:center; align-items:stretch}

.item{
  user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
  touch-action:none; /* iOS: 避免与滚动冲突，保证“跟手” */
  cursor:grab;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border); border-radius:14px; padding:12px 14px; display:flex; gap:10px; align-items:center;
  transition:transform .12s ease, box-shadow .12s ease, background .2s ease, border-color .2s ease;
  box-shadow:0 4px 12px rgba(0,0,0,.18);
  will-change: transform; transform: translateZ(0); /* iOS: 提升合成层，减少抖动 */
}
.item:focus{outline:2px solid var(--primary)}
/* handle 样式保留，但现在整卡可拖拽 */
.handle{
  width:22px; height:22px; border-radius:6px; background:rgba(255,255,255,.12); border:1px solid var(--border);
  display:grid; place-items:center; font-size:14px; color:var(--primary-strong);
}
.label{flex:1}
.badge{font-size:12px; color:var(--muted)}

.item.dragging{transform:scale(1.02); box-shadow:0 12px 28px rgba(0,0,0,.36)}
.placeholder{height:44px; border-radius:12px; border:2px dashed rgba(138,180,255,.6); background:rgba(138,180,255,.12)}
/* 拖拽期间的全局光标 */
body.drag-active, .item:active{cursor:grabbing}

.actions{display:flex; gap:10px; justify-content:flex-end; margin-top:14px; flex-wrap:wrap}
.btn{
  appearance:none; border:1px solid var(--border); background:var(--glass); color:var(--text);
  padding:10px 14px; border-radius:12px; cursor:pointer; transition:transform .08s ease, background .2s ease, border-color .2s ease;
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
}
.btn:hover{transform:translateY(-1px)}
.btn:disabled{opacity:.5; cursor:not-allowed}
.btn.primary{background:linear-gradient(180deg, #6f97ff, #4d7dff); color:#081025; border-color:transparent; font-weight:700}
.btn.ghost{background:transparent}

.share-box{display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; margin-top:16px}
.share-input{
  width:100%; padding:12px 14px; border-radius:12px; border:1px solid var(--border); background:rgba(0,0,0,.2);
  color:var(--text); outline:none;
}

.toast{
  margin-top:10px; color:#d4e4ff; min-height:20px; font-size:14px;
}

.grid3{display:grid; gap:16px; margin-top:14px}
@media(min-width:980px){ .grid3{grid-template-columns:1fr 1fr 1fr} }

.readonly-col{background:var(--card); border:1px solid var(--border); border-radius:16px; padding:12px}
.readonly-head{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:8px}
.ro-list{display:flex; flex-direction:column; gap:10px}
.ro-item{padding:10px 12px; border-radius:12px; border:1px solid var(--border); background:rgba(255,255,255,.06)}
.ro-rank{opacity:.8; font-size:12px}

.app-footer{opacity:.75; font-size:13px; text-align:center}

/* 可选：重复提示动画（如果后续需要） */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.shake { animation: shake .35s ease; }
